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

Bug 323986

Summary: JAXB Externalized Metadata: Need support for join-nodes on xml-elements (a.k.a. choice mappings)
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    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 323756    
Bug Blocks: 332770    
Attachments:
Description Flags
Proposed fix
none
Supporting tests
none
Proposed fix
none
Supporting tests
none
Proposed fix
none
Supporting tests
none
Supporting tests none

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