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

前端 未结 30 1759
既然无缘
既然无缘 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:30

    i get this error when i use

    getSession().save(object)
    

    but it works with no problem when I use

    getSession().saveOrUpdate(object) 
    

提交回复
热议问题