Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323986 - JAXB Externalized Metadata: Need support for join-nodes on xml-elements (a.k.a. choice mappings)
Summary: JAXB Externalized Metadata: Need support for join-nodes on xml-elements (a.k....
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: 323756
Blocks: 332770
  Show dependency tree
 
Reported: 2010-08-30 11:44 EDT by David McCann CLA
Modified: 2022-06-09 10:19 EDT (History)
0 users

See Also:


Attachments
Proposed fix (22.76 KB, patch)
2010-12-02 16:06 EST, David McCann CLA
no flags Details | Diff
Supporting tests (39.60 KB, patch)
2010-12-02 16:06 EST, David McCann CLA
no flags Details | Diff
Proposed fix (26.61 KB, patch)
2010-12-03 12:52 EST, David McCann CLA
no flags Details | Diff
Supporting tests (74.62 KB, patch)
2010-12-03 12:52 EST, David McCann CLA
no flags Details | Diff
Proposed fix (27.50 KB, patch)
2010-12-06 11:19 EST, David McCann CLA
no flags Details | Diff
Supporting tests (74.62 KB, patch)
2010-12-06 11:19 EST, David McCann CLA
no flags Details | Diff
Supporting tests (106.23 KB, patch)
2010-12-06 11:26 EST, 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-30 11:44:45 EDT
We need to support object reference / collection reference mappings via choice mapping.  In xml, this will involve modifications to xml-elements - we will need to add an element ref to xml-join-nodes.

There is currently a bug open to track supporting used of xml-idref with xml-elements - this fix will involve adding reference mapping support to our choice mappings.  Once this is resolved we can add support for xml-join-nodes on xml-elements.
Comment 1 David McCann CLA 2010-11-05 13:03:22 EDT
This is a non-trivial fix and will require additional annotation support.  More than likely we will need to wrap @XmlJoinNodes such that each entry in the @XmlElements list has an associated @XmlJoinNodes entry:

@XmlElements({
    @XmlElement(name="a", type=Address.class),
    @XmlElement(name="b", type=Phone.class),
    @XmlElement(name="c" type=Contact.class),
})
@XmlJoinNodesList({
    @XmlJoinNodes({
        @XmlJoinNode(xmlPath="add/@id", referencedXmlPath="@id"),
        @XmlJoinNode(xmlPath="add/city/text()", referencedXmlPath="city/text()")
    })
    @XmlJoinNodes({
        @XmlJoinNode(xmlPath="phn/@id", referencedXmlPath="@id"),
        @XmlJoinNode(xmlPath="phn/area/text()", referencedXmlPath="area/text()")
    })
    @XmlJoinNodes({
        @XmlJoinNode(xmlPath="con/@id", referencedXmlPath="@cid"),
        @XmlJoinNode(xmlPath="con/text()", referencedXmlPath="name/text()")
    })
})

This will not be done in the 2.2.0 timeframe;  setting the target milestone to 2.3.0
Comment 2 David McCann CLA 2010-12-02 16:06:13 EST
Created attachment 184405 [details]
Proposed fix
Comment 3 David McCann CLA 2010-12-02 16:06:26 EST
Created attachment 184406 [details]
Supporting tests
Comment 4 David McCann CLA 2010-12-03 12:52:18 EST
Created attachment 184489 [details]
Proposed fix
Comment 5 David McCann CLA 2010-12-03 12:52:51 EST
Created attachment 184490 [details]
Supporting tests
Comment 6 David McCann CLA 2010-12-06 11:19:31 EST
Created attachment 184620 [details]
Proposed fix
Comment 7 David McCann CLA 2010-12-06 11:19:43 EST
Created attachment 184621 [details]
Supporting tests
Comment 8 David McCann CLA 2010-12-06 11:26:55 EST
Created attachment 184622 [details]
Supporting tests
Comment 9 David McCann CLA 2010-12-06 12:00:11 EST
Reviewed by:  matt.macivor@oracle.com
Tests:  all unit tests pass as expected;  jaxb/annotations/xmlelementsjoinnodes/collection/XmlElementsJoinNodeTestCases; jaxb/annotations/xmlelementsjoinnodes/XmlElementsJoinNodeTestCases; jaxb/externalizedmetadata/mappings/choice/ChoiceMappingTestCases

Revision: 8632
Comment 10 Eclipse Webmaster CLA 2022-06-09 10:14:16 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 11 Eclipse Webmaster CLA 2022-06-09 10:19:31 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink