Hi Jerome, Thank you for your response. I was able to get it working as you describe, my problem was that I missed the part that the node had to be set to attribute. But not I am facing a different problem. What happens when the field that is doing the referencing is actually referencing an interface, where you could have instances of different classes. What I am seeing here is that the unmarshalling to xml looks ok but I can't go back from xml to java objects. Here is an example of the way I defined my mapping:
<class name=" ComplexType" identity="qualifiedName" > <field name="qualifiedName" type="string"/> </class>
<class name=" PrimitiveTypeEnum" identity="name" verify-constructable="false"> <field name="name" type="string"/> </class>
<class name=" Attribute"> <field name="type" type="TypeDescriptor" > <bind-xml name="attr_type" node="attribute" reference="true"/> </field> </class>
Both ComplexType and PrimitiveTypeEnum classes implement the interface TypeDescriptor. The Attribute Class has an attribute "type" of type TypeDescriptor. I don't see how castor can determine from the xml output which class to instantiate since the only thing that it outputs for the attr_type is the value and no class info.
Thanks
Shawn -----Original Message-----
Hi Shawn,
This an example of mapping file :
<class
name="pack3.lE" identity="leOid">
<class
name="pack3.aG" >
--Jerome
|
- Re: [castor-dev] Using the reference attribute for... Pastre Jerôme
- Re: [castor-dev] Using the reference attribut... Arvin, Shawn POP/Exch)
- Re: [castor-dev] Using the reference attribut... Pastre Jerôme
- Re: [castor-dev] Using the reference attribut... Arvin, Shawn POP/Exch)