Deleted entity passed to persist exception

前端 未结 4 1009
情歌与酒
情歌与酒 2021-02-08 13:57

I have this kind of entities:

Document | n .. to ..1 | DocumentType | 1 .. to .. n | PropertyType | 1 .. to

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-08 14:33

    Solution:

    • There was a CascadeType.REMOVE in a @ManyToOne relationship ! Removed it.

    Why this solution?

    • if you want to delete a child you SURELY do not want to delete its parent because there can be other children related to that parent.

提交回复
热议问题