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/JPA 2.0/mappedbyid

< EclipseLink‎ | Development‎ | JPA 2.0
Revision as of 14:36, 25 March 2009 by Unnamed Poltroon (Talk) (New page: = MappedById Support = JPA 2.0 Root | [http://bugs.eclipse.org/270011 Enhancement Request] ==Issue Summary== In JPA 1.0 primary key columns could on...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MappedById Support

JPA 2.0 Root | Enhancement Request

Issue Summary

In JPA 1.0 primary key columns could only be mapped to @Basic attributes. Primary Keys that were derived from Foreign Keys had to be mapped twice, once as the relationship mapping and again as an @Basic. JPA 2.0 adds the functionality to designate a Relationship as providing the primary key for an Entity, see | DerivedId . When using an embeddedid, a @MappedById annotation can be used on a relationship mapping to indicate that it uses the same Id field that is also defined by the target ID field in the Embeddedid.

See JPA 2.0 section 2.4.1 for details.

General Solution

The EmbeddedID will be difficult to support as values in the EmbeddedID will need to be populated by EclipseLink on persist(), merge() calls even though they are not the sources of Identity for the Entity. Even more complicated if the derived ID is an IdClass then an instance of that class must be stored in the EmbeddedId which will be new functionality in EclipseLink. Transformation Mapping may be leveraged in combination with the CMP3Policy to support this functionality.

Work Required

  1. Develop model for testing access type settings
    approx ? days
  2. Update Processing
    approx ? days

Back to the top