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

Difference between revisions of "EclipseLink/Development/JPA2.0/Extended Map support/MappedKeyMapContainerPolicy"

(New page: == CollectionTableMapMapping == JoinTableMapMapping will be any Map mapping that contains either part of it's key or part of its value in a CollectionTable. The initial design will be ba...)
 
(CollectionTableMapMapping)
Line 1: Line 1:
 
== CollectionTableMapMapping ==
 
== CollectionTableMapMapping ==
  
JoinTableMapMapping will be any Map mapping that contains either part of it's key or part of its value in a CollectionTable. The initial design will be based on ManyToManyMapping. The "value" portion of the Map will behave in a similar manner ot the target of the ManyToManyMapping.  The "key" part of the map will be an additional part of the mapping that is dealt with in a similar way to the keys that are added to the join table in ManyToMany mapping.
+
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.
  
More to come...
+
=== Basic Design ===
 +
 
 +
==== 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.
 +
 
 +
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.

Revision as of 11:25, 14 November 2008

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.

Basic Design

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.

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