Don't change the reference to a collection with cascade=“all-delete-orphan”
问题 I am getting an error: Don't change the reference to a collection with cascade="all-delete-orphan" while trying the following operation: beginTx(); Parent parent = new Parent(); Child child = new Child(); parent.addChild(child); getSession().save(parent); commitTx(); closeSession(); beginTx(); //id is the primary key child.setID(null); getSession().update(child); commitTx(); closeSession(); Parent and child are related by one-to-many with cascade = ' all-delete-orphan '. class Parent { Set