Hibernate 在 saveOrUpdate() NonUniqueObjectException错误
来源:互联网 发布:lol解封软件下载 编辑:程序博客网 时间:2024/05/06 13:55
Hibernate 在 saveOrUpdate() 一个 detached object 时候会报以下错误,
通常是 Web 页面修改和保存后出现
org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [domain.Director#9]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [domain.Director#9]
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [domain.Director#9]
if (object.getId() != null) {
getSession().merge(object);
} else {
getHibernateTemplate().saveOrUpdate(object);
}
觉得这种方法不是很完美,寻找更好的解决方法
修改了Dao实现
- Hibernate 在 saveOrUpdate() NonUniqueObjectException错误
- 出现 org.hibernate.NonUniqueObjectException 错误的解决方法
- Hibernate错误NonUniqueObjectException的处理办法
- Hibernate错误NonUniqueObjectException的处理办法
- org.hibernate.NonUniqueObjectException的错误,很蛋疼
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException学习
- org.hibernate.NonUniqueObjectException 问题
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException解决方法
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException
- org.hibernate.NonUniqueObjectException
- hibernate错误:org.hibernate.NonUniqueObjectException: a different object with the same identifier valu
- JTree的事件监听
- AppFuse 里面丑陋的 default.jsp
- 改变你一生的五句话
- 如何删除 Visual Studio .NET 2003
- petshop4.0研究(二)
- Hibernate 在 saveOrUpdate() NonUniqueObjectException错误
- 用户,你太宽容了
- 跨厂商编程
- 一个用在java项目中的日期选择组件
- 可以杀任何进程的代码
- 如何创建透明的FLASH
- 用jsp连接数据库大全
- 我是如何爱上vi的
- HTTP深入浅出