Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324097 - JAXB: XmlPath is not being used when setting primary key for XmlID
Summary: JAXB: XmlPath is not being used when setting primary key for XmlID
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-31 10:30 EDT by David McCann CLA
Modified: 2022-06-09 10:24 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (7.57 KB, patch)
2010-09-01 14:12 EDT, David McCann CLA
no flags Details | Diff
Supporting test case (11.95 KB, patch)
2010-09-01 14:12 EDT, David McCann CLA
no flags Details | Diff
Proposed fix v2 (8.76 KB, patch)
2010-09-01 15:27 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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