开发者

Not to delete child record on deleting parent table record

开发者 https://www.devze.com 2023-01-27 17:37 出处:网络
I am little bit newbie in Hibernate and DBMS and stuck on a problem. I have two table. One is A and second is B. There is Many-to-One relationship between these two tables. Now on removing one record

I am little bit newbie in Hibernate and DBMS and stuck on a problem. I have two table. One is A and second is B. There is Many-to-One relationship between these two tables. Now on removing one record from table A I do not want 开发者_Python百科to delete the record from table B. What type of cascading strategy should I apply.

Please help.


Here's what Hibernate manual says.
Based on what you wrote I think you should use cascade="persist,merge,save-update"

0

精彩评论

暂无评论...
验证码 换一张
取 消