Class OneManyMapTest


  • public class OneManyMapTest
    extends DemoBase
    This class demonstrates a One-to-Many relationship represented as a map in the parent. There are two types of parents and children represented in these tests:
  • OneManyInverseParent to/from OneManyOwningChild - in this case, the foreign key to the parent is supplied in the child table. The child owns the relationship and the parent has a inverse reference back to the child represented as a Map.
  • OneManyOwningParent to OneManyChild - in this case, the parent owns the relationship and the child class knows nothing of the relationship. The parent forms a link table to host the 1:1 foreign key to the child and a 1:N relationship to the parent. The child object is referenced by the parent through a Map.
  • The other cases are meaningless to demonstrate because they would either involve the parent not knowing about the child (thus no Map), or neither parent or child knowing about one another (totally senseless for this example).