Ok, I've been messing around with this for 3 days now and can't figure
something out so I'm reaching out to this forum to see if I can get some
insight into whatever it is I'm doing wrong. This use case to me seems very
simple yet I can't get it to work so I'm thinking I'm missing something very
fundamental here and it's not obvious to me.
The concept is simple - map this systemId attribute from the XML
CreateBusinessEntity.BusinessEntity.AltId@systemId
To this ds String object within the deep graph
BusinessEntity.BusinessEntityUDA[].BusinessEntityUDAValue[].UDAField.ds
----------------- class hierarchy --------------------
public class BusinessEntity {
List<BusinessEntityUDA> UDAs;
}
public class BusinessEntityUDA {
List<BusinessEntityUDAValue> values;
}
public class BusinessEntityUDAValue {
UDAField field;
}
public class UDAField {
String ds;
}
----------------- binding config --------------------
<?xml version="1.0" encoding="UTF-8"?>
<binding>
<mapping name="BusinessEntity"
class="com.porticosys.domain.provider.BusinessEntity">
<collection field="UDAs" usage="optional"
create-type="java.util.ArrayList">
<structure type="com.porticosys.domain.provider.BusinessEntityUDA">
<collection field="values" usage="optional"
create-type="java.util.ArrayList">
<structure name="AltId"
type="com.porticosys.domain.provider.BusinessEntityUDAValue">
<value style="text" field="value"/>
<structure name="field"
type="com.porticosys.domain.uda.UDAField">
<value name="systemId" style="attribute"
field="ds"/>
</structure>
</structure>
</collection>
</structure>
</collection>
</mapping>
</binding>
----------------- sample message --------------------
<CreateBusinessEntity>
<BusinessEntity id="12345677" name="Some Health System" tin="12-345678"
type="HS">
<AltId systemId="SYS_A">1234567890</AltId>
<AltId systemId="SYS_B">0987654321</AltId>
</BusinessEntity>
</be:CreateBusinessEntity>
----------------- error --------------------
Error: References to structure object must have compatible types:
com.porticosys.domain.provider.BusinessEntityUDAValue cannot be used as
com.porticosys.domain.uda.UDAField; on structure element at (line 10, col
87, in BusinessEntity-binding.xml)
--
View this message in context:
http://old.nabble.com/Nested-Structures---how-to-map--tp34276687p34276687.html
Sent from the jibx-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users