Hibernate Update方法提交错误

最近用通用Dao更新对象,报了以下错误

Row was updated or deleted by another transaction 
(or unsaved-value mapping was incorrect) : 
[com.xxbs.domain.Users#0]

 

这个是因为在更新之前没有找到对象造成的,要先用get等方法找到对应对象,后面的更新对这个对象更新,而不能用new Users

 

posted @ 2019-04-24 16:54  ꧁༺๑一棵开花的树๑༻꧂  阅读(355)  评论(0)    收藏  举报