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

Bug 324097

Summary: JAXB: XmlPath is not being used when setting primary key for XmlID
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Supporting test case
none
Proposed fix v2 none

Description David McCann CLA 2010-08-31 10:30:00 EDT
In the setPKField method on MappingsGenerator, the property's schemaName is used to construct the primary key field name.  In the case of an XmlID set on a property that also has an XmlPath, the XmlPath value should be used as the primary key field name.

Since the descriptor and mappings have been setup at this point, we should leverage the work done when constructing the mappings when setting the pk field name.
Comment 1 David McCann CLA 2010-09-01 14:12:29 EDT
Created attachment 177991 [details]
Proposed fix
Comment 2 David McCann CLA 2010-09-01 14:12:50 EDT
Created attachment 177992 [details]
Supporting test case
Comment 3 David McCann CLA 2010-09-01 15:27:43 EDT
Created attachment 177998 [details]
Proposed fix v2

Put constants for "@" and "/text()" back and made use of them where appropriate.
Comment 4 David McCann CLA 2010-09-01 15:47:25 EDT
Fix for  Bug 324097 -  JAXB: XmlPath is not being used when setting primary key for XmlID
Reviewed by:  blaise.doughan@oracle.com
Tests: all unit tests pass as expected; jaxb/externalizedmetadata/xmlidref/XmlIdRefTestCases
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:24:40 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink