How to fix the Hibernate “object references an unsaved transient instance - save the transient instance before flushing” error

前端 未结 30 1553
既然无缘
既然无缘 2020-11-22 07:11

I receive following error when I save the object using Hibernate

object references an unsaved transient instance - save the transient instance before flushi         


        
30条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 07:17

    For the sake of completeness: A

    org.hibernate.TransientPropertyValueException 
    

    with message

    object references an unsaved transient instance - save the transient instance before flushing
    

    will also occur when you try to persist / merge an entity with a reference to another entity which happens to be detached.

提交回复
热议问题