Hibernate常见错误之save the transient instance before flushing
来源:互联网 发布:linux内核升级步骤 编辑:程序博客网 时间:2024/06/15 12:03
在Hibernate多表操作的“一对多|多对一”中,初学Hibernate的小伙伴可能在学习过程中会遇到这样的错误信息,然后我也遇到了
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: ...............
这个错误可能是由以下原因引起的:
1、save顺序不正确(百度得到的结果)
比如公司表和职员表,职员表存有公司的ID外键,是一对多的关系。在进行操作的时候应该是先执行公司表的save操作,再执行职员表的save操作。
2、在执行一对多的添加操作时,未对新增的对象的实行save操作。(自己在写demo的犯的错误)
最后祝大家早日处理好程序的异常。
阅读全文
0 0
- Hibernate常见错误之save the transient instance before flushing
- save the transient instance before flushing错误解决办法
- save the transient instance before flushing
- save the transient instance before flushing
- save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing异常
- object references an unsaved transient instance - save the transient instance before flushing(异常总结)
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing .
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing(异常总结)
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- 代理模式小结
- PF_Manager
- UVA
- WIN7 磁盘分区
- HDU-1286-找新朋友
- Hibernate常见错误之save the transient instance before flushing
- 数学符号读法大全
- 水题:HDU1716-排列2
- lua-5 模块与包
- LeetCode 628 Maximum Product of Three Numbers
- 关于SVC和SHVC的残酷事实
- 【项目实战】自监控-09-DataFrame索引操作(上篇)
- ForkJoinPool框架示例
- 循环结构,理念,逻辑