Workarounds for Hibernate's lack of delete-orphan support for one-to-one and many-to-one relationships?

前端 未结 4 1802
春和景丽
春和景丽 2021-02-05 11:57

Hibernate has no support for \"delete-orphan\" cascading of one-to-one or many-to-one relationships. I recently discovered this, and it\'s giving me a serious headache. I have

4条回答
  •  深忆病人
    2021-02-05 12:17

    The workaround described here https://forum.hibernate.org/viewtopic.php?p=2379216 worked for me. It uses @OneToMany association with a single element on the "many" side to implement a @OneToOne association and solve the remove-orphans problem.

提交回复
热议问题