在hibernate中级联被启用为all- delete -all一对多双向关联中,hibernate是否有可能尝试使用外键列删除子实体?它从子查询where foreign_key_col = parent_primary_key中触发一个额外的查询delete。
发布于 2020-07-19 12:37:38
对于双向关系,如果删除父实体中的级联。
您可以直接从父对象中删除该子对象。
//set parent as null
child.setParent(null)
//parent.children.iterater and remove it from the iterator.
//then save the parent.
save(parent)https://stackoverflow.com/questions/62967255
复制相似问题