当前位置: 代码迷 >> 综合 >> org.hibernate.TransientObjectException: object references an unsaved transient instance - save the t
  详细解决方案

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the t

热度:26   发布时间:2024-02-23 23:40:19.0

报错:org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.hp.pms.project.entity.Project

解决办法:将many-to-one的级联设为: cascade="save-update,persist"或cascade=“all”

<many-to-one name="group" column="groupid" cascade="save-update,persist"></many-to-one>

参考博文:https://blog.csdn.net/sdyy321/article/details/5984226;
https://blog.csdn.net/u012159094/article/details/26073679

  相关解决方案