Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313204

Summary: [API] Incorrect validation errors on EclipseLink example of derivied Id?
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Paul Fullbright <paul.fullbright>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge
Version: 2.3   
Target Milestone: 3.4 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
example jpa project none

Description Karen Butzke CLA 2010-05-17 13:44:03 EDT
Created attachment 168775 [details]
example jpa project

In the attached example project you will see 2 validation errors on the Captain entity. EclipseLink handles this particular use case.

- Embedded IDs that are mapped by a relationship should not specify any attribute overrides.

- The type of the ID mapped by the relationship 'major' does not agree with the primary key class of the target entity.
Comment 1 Neil Hauge CLA 2010-06-03 17:38:26 EDT
Investigate for 2.3.1.
Comment 2 Paul Fullbright CLA 2010-06-28 12:59:37 EDT
The workaround for this is to add a value to the maps id annotation.

@MapsId("major")
Comment 3 Paul Fullbright CLA 2010-06-30 14:50:57 EDT
The workaround is potentially technically incorrect, as EclipseLink (as a reference implementation) represents the default value of the @MapsId as "id", although what happens under the covers seems equivalent.

At any rate, solving this problem in maintenance seems problematic.  It's likely we'll need a more sophisticated API to address this issue, so I'm re-targeting to next release.
Comment 4 Neil Hauge CLA 2011-07-01 16:26:48 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 5 Neil Hauge CLA 2011-10-07 12:52:08 EDT
Targeting to Juno release.
Comment 6 Paul Fullbright CLA 2013-07-11 14:21:05 EDT
Committed for M1