Hibernate unidirectional one to many association – why is a join table better?

Consider the situation where the owned entity type can also be owned by another parent entity type. Do you put foreign key references in the owned table to both parent tables? What if you have three parent types? It just doesn’t scale to large designs.

A join-table decouples the join, so that the owned table has no knowledge of the parent table(s), allowing the design to scale elegantly.

Leave a Comment