Can I add 'ON DELETE CASCADE' to tables managed by Hibernate?

后端 未结 6 1738
不知归路
不知归路 2021-01-04 00:14

I have some tables managed by Hibernate with various foreign key constraints. Cascade on delete is currently managed by Hibernate alone. For playing around with test data I

6条回答
  •  粉色の甜心
    2021-01-04 00:46

    Don't use cascade = CascadeType.REMOVE Documentation here

    Because of your db may be destroyed. You can use formal order. Delete sub stable and then remove master table

提交回复
热议问题