Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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"

(The Details)
Line 13: Line 13:
 
::: - AggregateCollectionMapping
 
::: - AggregateCollectionMapping
 
::: - Bi-directional OneToMany
 
::: - Bi-directional OneToMany
::: - [[uni-directional_onetomany_mapping|''New'' Uni-directional OneToMany mapping]]
+
::: - [[EclipseLink/Development/JPA2.0/uni-directional_onetomany_mapping|''New'' Uni-directional OneToMany mapping]]
  
 
:: JPA Mappings
 
:: JPA Mappings

Revision as of 11:45, 18 July 2008

Map Support

Enhancement Request

Issue summary

Map support as defined in JPA 2.0 will require new mapping functionality for EclipseLink. The specification will allow any JPA 1.0 relationship mapping to be stored in a map with key being a primitive, an Embeddable or an Entity. For this support no user defined mapping or property exists on the target of the relationship as is the case in our current support. An additional complication is that the location of the Key fields exist on the relation table if one exists.

The Solution in General

The general approach to implementing this functionality will be to produce Map mappings that encapsulate two EclipseLink mappings. A generated mapping that represents the Key attribute and a user defined mapping that represents the value of the map. It is expected that two Map Mappings will be needed a Mapping where the Key mapping columns are found in the target table and another where the Key mapping columns are found in the relation table.

The Details

Target Table Map Mapping
This support will cover the case where the Map key columns exist in the target table
EclipseLink Mappings Involved
- AggregateCollectionMapping
- Bi-directional OneToMany
- New Uni-directional OneToMany mapping
JPA Mappings
- Bi-directional OneToMany mapping
- Uni-directional OneToMany with @JoinColum
- ElementCollection<*, Primitive> mapping
- ElementCollection<*, Embeddable> mapping
Join Table Map Mapping
This support will cover the case where the Map key columns exist in the Join table
EclipseLink Mappings Involved
- ManyToMany mapping
JPA Mappings
- default Uni-directional OneToMany with @JoinColum
- ManyToMany mapping
- Note: The specification disallows both sides of a mapping using a Map collection but there is no technical reason to do this as one side will be read-only anyway.

Back to the top