HibernateTemplate SaveOrUpdateAll [英] HibernateTemplate SaveOrUpdateAll

查看:192
本文介绍了HibernateTemplate SaveOrUpdateAll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HibernateTemplate类具有以下方法:

$ getHibernateTemplate()。saveOrUpdateAll(集合实体)

但为什么它不仅存在 saveAll()方法?像这样

  getHibernateTemplate()。saveAll(集合实体)

如果我只想保存集合而不更新它,会发生什么情况?

解决方案

saveOrUpdateAll(集合实体)本身也将用于saveAll(集合实体)的目的..这可能是原因。


HibernateTemplate class has following method

getHibernateTemplate().saveOrUpdateAll(Collection entities)

But why it has not only saveAll() method? like this

getHibernateTemplate().saveAll(Collection entities)

what happened if I only want to save collection not to update it?

解决方案

saveOrUpdateAll(Collection entities) itself will serve the purpose of saveAll(Collection entities) also.. this could be the reason

这篇关于HibernateTemplate SaveOrUpdateAll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆