How to update the list after delete an item of that list

前端 未结 2 1601
悲哀的现实
悲哀的现实 2021-01-16 07:31

It will take a moment for me to explain this, so please stay with me. I have table NewsFeed that has OneToMany relationship with itself.

@Entit         


        
2条回答
  •  我在风中等你
    2021-01-16 08:21

    When you delete an object you must remove all reference to that object before deleting it. If you do not, you can get a constraint error, or stale data in your persistence context, or in the 2nd level cache.

    When removing the Feed, first remove it from the replies.

提交回复
热议问题