Class ManyManyMapTest


  • public class ManyManyMapTest
    extends DemoBase
    This class demonstrates a Many-to-Many relationship represented as a Map in the owning entity. There are two types of entities represented in these tests. In each case, the foreign key is placed in a link table.
  • ManyManyInverseEntity to/from OneManyOwningEntity - One end owns the relationship and the other end is the inverse. The inverse side has a reference to the owning side, but the application code (DAO or business logic) is responsible for maintaining the inverse side's reference.
  • ManyManyOwningEntity to ManyManyEntity - since all foreign key information about the relationship is stored in a link/join table, this is almost identical to the case described above except that the non-owning side has no knowledge of the relationship. All this means is that the application code has no responsibility to update the inverse side.