I have a simple model with a Question
and Choice
object.
It is also important to remember that without mappedBy
you will run into an issue of circular dependencies. This happens when there is no owner in a bidirectional relationship.
In a circular dependency you will (explicitly) set both sides of the entities before saving
thisObj.set(thatObj);
thatObj.set(thisObj);