Parent-aware unidirectional @OneToMany relationship in Hibernate/JPA

In a classical unidirectional one-to-many relation, the referred entity (Call) is not aware of its parent (Bill). public class Bill { (...) @OneToMany( fetch = FetchType.LAZY, cascade = CascadeType.ALL) <b>@JoinColumn</b>(name = "billId") private Set calls; (...) } Though, there may be some cases, where it is reasonable to make the information of the relation also available in the child entity (again, Call), e.g. if you want to retrieve all Calls of a specific Bill....

April 15, 2013 · 1 min · Markus Ruepp