I have a Department entity which relations are as follows:
Many departments can be in one parent department:
Just code it:
for (Department child : parent.getChildren()) { child.setParentDepartment(null); } session.delete(parent);