how to define an inverse cascade delete on a many-to-one mapping in hibernate

后端 未结 2 512
我寻月下人不归
我寻月下人不归 2020-12-09 04:39

I have two classes A and B. Many B\'s can have association with a single A, hence a many-to-one relationship from B to A. I\'ve mapped the relationship like:



        
2条回答
  •  长情又很酷
    2020-12-09 04:58

    I think you need to cascade="all,delete-orphan" from A to B's with a one-to-many association.

提交回复
热议问题