NonUniqueObjectException问题的解决
来源:互联网 发布:网络催眠音频 编辑:程序博客网 时间:2024/04/30 23:15
在公司做模块的时候遇到了NonUniqueObjectException 错误,
- a different object with the same identifier value was already associated with the session:
- [com.......#1462109];
- nested exception is org.hibernate.NonUniqueObjectException:
- a different object with the same identifier value was already associated with the session:
- [com. .....#1462109]
看错误的原因是因为针对一个对象加载了引用,由于有多个引用指向一个对象,在你去update的时候,出现了对象不同步问题,hibernate不知道要保存哪个对象,查了下原因,原来是我所做的hibernate映射在主表中对子表做映射的时候设置了lazy="false",这样主表在查取数据的时候就会相应的也把子表的数据取出来,然后在子表的编辑页面做update操作的时候就又加载了一个引用,现在去更新它的时候,hibernate就不知道更新哪个了。
解决办法,将lazy="true" 或者默认不设置即可。
- NonUniqueObjectException问题的解决
- org.hibernate.NonUniqueObjectException 个人的解决
- hibernate merge 的作用 (如何解决 NonUniqueObjectException)
- org.hibernate.NonUniqueObjectException 问题
- NonUniqueObjectException
- .NonUniqueObjectException: a different object with the same identifier等的解决
- hibernate异常NonUniqueObjectException的处理
- 异常org.hibernate.NonUniqueObjectException及其解决
- 出现 org.hibernate.NonUniqueObjectException 错误的解决方法
- org.hibernate.NonUniqueObjectException 个人的解决办法
- Hibernate错误NonUniqueObjectException的处理办法
- Hibernate错误NonUniqueObjectException的处理办法
- org.hibernate.NonUniqueObjectException的错误,很蛋疼
- org.hibernate.NonUniqueObjectException的原因与解决方法
- org.hibernate.NonUniqueObjectException的原因与解决方法
- Hibernate 保存对象出现 org.hibernate.NonUniqueObjectException 及解决
- Hibernate Session篇--org.hibernate.NonUniqueObjectException分析及解决
- getHibernateTemplate().update()异常分析与解决(NonUniqueObjectException 异常)
- 启程
- VC++6.0编译环境介绍
- c# collection class
- 画菱形
- 渔夫分鱼算法
- NonUniqueObjectException问题的解决
- 计算机英语
- ASP.NET长文章分页显示函数
- DW: Some useful system views when checking Materialized View
- Struts2控制文件下载
- 用ed实现在文件开头插入文本
- Struts 购物车的实现 用Map集合
- C++的链接错误LNK2005
- Create pseudo-random numbers based on Fibonacci sequence