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.
EclipseLink/Development/JPA2.0/uni-directional onetomany mapping
Contents
Uni-directional OneToMany with Target Table
JPA 2.0 Root | 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
A new mapping UnidirectionalOneToManyMapping will be defined. It will handle adding and removal of target objects following the pattern established in ManyToManyMapping. The new mapping will not be private owned by default.
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 7 days
- Process @JoinColumn annotation and xml on a OneToMany mapping and test
- approx 2 days