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/uni-directional onetomany mapping"

Line 3: Line 3:
 
==Issue Summary==
 
==Issue Summary==
 
The JPA 1.0 specification only allows for uni-direction OneToMany mapping that uses a Join Table but the JPA 2.0 specification will require support for a uni-direction OneToMany mapping where no Join Table is involved.  The defaulting rules for a Uni-directional OneToMany have not changed and defaulted uni-directional OneToMany mappings will still default to using a Join Table but if the developer provides @JoinColumn or @JoinColumns on the uni-directional OneToMany mapping then a target table mapping must be used.
 
The JPA 1.0 specification only allows for uni-direction OneToMany mapping that uses a Join Table but the JPA 2.0 specification will require support for a uni-direction OneToMany mapping where no Join Table is involved.  The defaulting rules for a Uni-directional OneToMany have not changed and defaulted uni-directional OneToMany mappings will still default to using a Join Table but if the developer provides @JoinColumn or @JoinColumns on the uni-directional OneToMany mapping then a target table mapping must be used.
 +
 +
See JPA 2.0 ED 9.1.33 for details
  
 
==General Solution==
 
==General Solution==
The solution for this functionality will based on the structure of the current AggregateCollectionMapping.  If a similar mapping is created where the target class descriptor is not marked as being a member of an Aggregate Collection then the target should be treated as an Entity.  The private owned nature will also have to be removed.
+
The solution for this functionality will be based on the structure of the current AggregateCollectionMapping.  If a similar mapping is created where the target class descriptor is not marked as being a member of an Aggregate Collection then the target should be treated as an Entity.  The new mapping will not be private owned by default.
  
==Requirements==
+
==Work Required==
 +
# Develop model for testing including joining queries
 +
## approx 1 day
 +
# Develop a mapping that supports uni-directional OneToMany mapping in EclipseLink that does not use Join Table
 +
## approx 10 days
 +
# Process @JoinColumn annotation and xml on a OneToMany mapping and test
 +
## approx 2 days

Revision as of 17:03, 18 July 2008

Uni-directional OneToMany with Target Table

Enhancement Request

Issue Summary

The JPA 1.0 specification only allows for uni-direction OneToMany mapping that uses a Join Table but the JPA 2.0 specification will require support for a uni-direction OneToMany mapping where no Join Table is involved. The defaulting rules for a Uni-directional OneToMany have not changed and defaulted uni-directional OneToMany mappings will still default to using a Join Table but if the developer provides @JoinColumn or @JoinColumns on the uni-directional OneToMany mapping then a target table mapping must be used.

See JPA 2.0 ED 9.1.33 for details

General Solution

The solution for this functionality will be based on the structure of the current AggregateCollectionMapping. If a similar mapping is created where the target class descriptor is not marked as being a member of an Aggregate Collection then the target should be treated as an Entity. The new mapping will not be private owned by default.

Work Required

  1. Develop model for testing including joining queries
    1. approx 1 day
  2. Develop a mapping that supports uni-directional OneToMany mapping in EclipseLink that does not use Join Table
    1. approx 10 days
  3. Process @JoinColumn annotation and xml on a OneToMany mapping and test
    1. approx 2 days

Back to the top