Hello, I have a simple class CustomQuoteRequest:
public class CustomQuoteRequest {
private String requestId;
private String currencyPairCode;
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getCurrencyPairCode() {
return currencyPairCode;
}
public void setCurrencyPairCode(String currencyPairCode) {
this.currencyPairCode = currencyPairCode;
}
}
I would like to map currencyPairCode to two different attributes in the xml. This is the MOXy mapping file I am using:
<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="com.anz.fxeasy.domain.model.quote.CustomQuoteRequest" xml-accessor-type="FIELD">
<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>
<xml-element java-attribute="currencyPairCode" xml-path="QuotReq/QuoteReq/Leg/Leg/@Sym"></xml-element>
</java-attributes>
</java-type>
</java-types>
However the second xml-element seems to override the previous one. Any ideas? Thanks a lot