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

Bug 328135

Summary: Externalized metadata must allow for multiple mappings to be created for a single property.
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david.mccann, david.twelves
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 332770, 348118    
Attachments:
Description Flags
Proposed fix
none
Supporting tests
none
Proposed fix
none
Supporting tests none

Description Blaise Doughan CLA 2010-10-19 10:33:22 EDT
The MOXy externalized metadata must allow multiple mappings to be created for the same property.  This comes with the condition that at most one mapping is readable.

The following metadata should produce two mappings for the currencyPairCode property:

<xml-bindings
    xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/oxm http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_1.xsd"
    >
    <java-types>
        <java-type name="forum78.CustomQuoteRequest"  xml-accessor-type="FIELD" xml-customizer="forum78.CustomQuoteRequestCustomizer">
            <xml-root-element name="FIXML"/>
            <java-attributes>
                <xml-element java-attribute="requestId" xml-path="QuotReq/@ReqId"/>
                <xml-element java-attribute="currencyPairCode" xml-path="QuotReq/QuoteReq/Instrmt/@Sym"/>
                <xml-element java-attribute="currencyPairCode" xml-path="QuotReq/QuoteReq/Leg/Leg/@Sym" write-only="true"/>
            </java-attributes>
        </java-type>
    </java-types>
</xml-bindings>
Comment 1 David McCann CLA 2010-11-24 14:35:24 EST
Created attachment 183793 [details]
Proposed fix
Comment 2 David McCann CLA 2010-11-24 14:35:46 EST
Created attachment 183796 [details]
Supporting tests
Comment 3 David McCann CLA 2010-11-25 10:24:39 EST
Created attachment 183859 [details]
Proposed fix
Comment 4 David McCann CLA 2010-11-25 10:24:51 EST
Created attachment 183860 [details]
Supporting tests
Comment 5 David McCann CLA 2010-11-25 10:26:57 EST
Reviewed by:  matt.macivor@oracle.com
Tests:  all unit tests pass as expected; jaxb/externalizedmetadata/mappings/multiple/MultipleMappingPerFieldTestCases

Revision: 8565
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:25:32 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink