Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Hibernate 和 DBMS 的新手,遇到了一个问题。我有两张桌子。一是A,二是B。这两个表之间存在多对一关系。现在,在从表中删除一条记录时,A我不想从表中删除该记录B。我应该应用什么类型的级联策略。
A
B
请帮忙。
这是 Hibernate 手册所说的。 根据你写的我认为你应该使用cascade="persist,merge,save-update"
cascade="persist,merge,save-update"