org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations):

前端 未结 4 879
面向向阳花
面向向阳花 2020-12-09 11:42

i am getting the above error \"org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): \". could someone

4条回答
  •  生来不讨喜
    2020-12-09 12:14

    This exception tells that Object that you are deleting is also mapped with collection of any entity, and your cascade in that collection id all. So if you want to delete any way you can change your cascade to

    cascade = CascadeType.DETACH
    

提交回复
热议问题