Hi,

Thanks for replying.


Werner Guttmann wrote:
> 
> Sure. Have a look at
> http://castor.org/xml-mapping.html#6.-Location-attribute
> 
> to see how you could use the 'location' attribute.
> 

I have tried this, but as both my Classes still map to the same root element
of user, the unmarshaller seems to only use the first one it finds in the
xml mapping file.

I tried it like this:

<class name="to.request.PokerCashMoneyToTableRequestTO">
 <map-to xml="user"/>
<field name="amount" type="integer">
<bind-xml name="amount" node="attribute" location="moneytotable"/>
</field>
 </class>


 <class name="to.request.PokerCashLeaveTableRequestTO">
 <map-to xml="user"/>
<field name="amount" type="integer">
        <bind-xml name="amount" node="attribute" location="moneyfromtable" />
</field>
</class> 

....and when i tried to unmarshall PokerCashLeaveTableRequestTO, it still
tries to use the other one and throws ClassCastExceptions.
-- 
View this message in context: 
http://www.nabble.com/mapping-2-classes-to-different-sub-element-tp16804683p16805788.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to