Be Careful When Using Parent-Child Associations in Hibernate

Parent-child relationships are a special case of more general 1:M associations. They are simply part-whole relationships and for Hibernate it is not meaningful that parts (childs) should exist without belonging a whole (parent). Parent-child association is specified with orphanRemoval attribute of @OneToMany annotation. Hibernate achieves this by employing a special persistent collection implementation. First thing […]