ORM and JPA: entity relationships, owning sides and mappedBy
Mapping one-to-one, one-to-many and many-to-many in JPA: where the foreign key goes, owning sides and mappedBy, @MapsId, cascades and orphanRemoval, Set instead of List for @ManyToMany, and when a join table needs its own entity.