Differences among save, update, saveOrUpdate, merge methods in Session?

后端 未结 7 2451
粉色の甜心
粉色の甜心 2020-12-04 08:50

I am new to Hibernate and went through the Hibernate tutorial last week. I have a few doubts about methods save, update, saveOrUpdate and merge in the Session class. These a

7条回答
  •  眼角桃花
    2020-12-04 09:32

    update() is for the detached objects , and for transient objects . if invoke on persistent objects it will throw a NonUniqueObjectException, and this will be addressed by merge().

提交回复
热议问题