/**
* @Name: saveObjectByCollection
* @Description: 使用集合的形式进行批量保存
* saveObjectByCollection(Collection<T> entities)
* 上面那里一定要中集合对象!否则框架不认识!。
* @Author: lazyJR
* @Parameters: Collection<T> entities 集合对象
* @Return: 无
*/
public void saveObjectByCollection(Collection<T> entities) {
this.getHibernateTemplate().saveOrUpdateAll(entities);
}
Collection entities这里一定要是集合对象,如果用什么list,数组,框架不认识,就会报标题的错误。
本文介绍了一种使用集合形式批量保存实体对象的方法,通过调用框架提供的saveOrUpdateAll方法实现。强调了传入参数必须为集合类型。
924

被折叠的 条评论
为什么被折叠?



