Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316465 - JAXB Externalized Metadata: Schema gen incorrect when setting XPath via XmlPath annotation
Summary: JAXB Externalized Metadata: Schema gen incorrect when setting XPath via XmlPa...
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-06-10 10:08 EDT by David McCann CLA
Modified: 2022-06-09 10:30 EDT (History)
0 users

See Also:


Attachments
Contains fix + test case mods for 2.2 stream (5.58 KB, patch)
2010-06-15 11:53 EDT, David McCann CLA
no flags Details | Diff
Contains fix + test case mods (4.33 KB, patch)
2010-07-09 09:51 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-06-10 10:08:34 EDT
The XPath set on the XmlPath annotation is not set properly such that schema generation will work properly.  For example, if the following was set:

  @XmlAttribute
  @XmlPath("@id")
  public int empId;

we would expect the following to be generated:

  <xsd:attribute name="id" type="xsd:int" use="required"/>

but instead we get:

  <xsd:attribute name="empId" type="xsd:int" use="required"/>

The fix should be done in AnnotationsProcessor.buildNewProperty():  we need to set the schemaName property on Property, as this value is used for the schema component name during schema generation.
Comment 1 David McCann CLA 2010-06-15 11:52:02 EDT
Required in:

  2.1
  2.2
Comment 2 David McCann CLA 2010-06-15 11:53:42 EDT
Created attachment 171958 [details]
Contains fix + test case mods for 2.2 stream
Comment 3 David McCann CLA 2010-07-09 09:51:26 EDT
Created attachment 173858 [details]
Contains fix + test case mods
Comment 4 David McCann CLA 2010-07-09 10:34:07 EDT
Fix checked into the 2.1 stream.  Now both 2.2 and 2.1 contain this fix.

Reviewed by:  matt.macivor@oracle.com
Tests: all unit tests pass as expected; jaxb/externalizedmetadata/mappings/direct/DirectMappingTestCases
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:30:44 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink