I have a simple Parent/Child relationship defined as:
Code:
<class name="Parent" table="parent">
...
<set name="children" cascade="delete-orphan">
<key column="parentId" />
<one-to-many class="Child" />
</set>
</class>
<class name="Child" table="child">
...
<property name="parentId" />
</class>
Now when I call parent.getChildren().remove(child) Hibernate first preforms a SQL update of parentId = null on the child row being removed, then it performs the delete. However, in normal operations the parentId column is set to "NOT NULL" so this triggers a constraint error. Is there a way to turn this behavior off so that the child is simply deleted without the initial null update? Thanks!