Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Development/JPA2.0/Extended Map support/MappedKeyMapContainerPolicy

< EclipseLink‎ | Development‎ | JPA2.0/Extended Map support
Revision as of 11:40, 14 November 2008 by Unnamed Poltroon (Talk) (CollectionTableMapMapping)

CollectionTableMapMapping

CollectionTableMapMapping will be any Map mapping that contains either part of it's key or part of its value in a CollectionTable. Much of CollectionTableMapMapping's functionality will be similar to ManyToManyMapping because of the fact that both mappings use a relation table.

Mapping Changes

Mapping Hierarchy

RelationTableMapping will be created as a common superclass for mappings that use a relation table. The majority of the code that will appear in RelationTableMapping will be moved from ManyToManyMapping.

ManyToManyMapping will now inherit from RelationTableMapping, and now contain the information and functionality to cope with the target part of the relationship. (i.e. The join from the relation table to the target table.)

The new CollectionTableMapMapping class will be added as a subclass of RelationTableMapping. It will hold mappings for its key and its value and the code necessary to manage those relationships.

MapComponentMapping

A new interface will be created call MapComponentMapping. This interface will provide the API that mapping that can be either the key or the value for a CollectionTableMapMapping must implement. The following mappings will implement this interface:

  • AbstractDirectMapping
  • AggregateObjectMapping
  • OneToOneMapping

Only MapComponentMappings will be eligable as the key or value of a CollectionTableMapMapping.

Container Policy Hierarchy

A new subclass of MapContainerPolicy will be added called CollectionTableMapContainerPolicy. It's main purpose will be to extend MapContainerPolicy to allow the key to be treated as a first-class element.

The way container policies work will change somewhat because CollectionTableMapMapping means that for the first time, one mapping actually encapsultes two distinct mappings. As a result, the iterator currently provided by ContainerPolicy will have some functionality added to allow it to iterate through objects that may or may not be key-value pairs. Any code that makes use of an iterator for a ContainerPolicy will have to be updated to be aware that the returned values could be a key-value pair.

Back to the top