Hi!

I have a problem with the following mapping:

<mapping class="NegotiationState" name="negotiation-state">
 <value name="gpk" field="gpk" style="attribute"/>
 <structure field="subStatus" type="SubStatus" usage="optional"/>
 ...
</mapping>

<mapping class="SubStatus" name="substatus">
 <value name="substatus-s" field="_subStatusS" get-method="toString"
set-method="setSubStatus" style="element" usage="optional"/>
</mapping>

When I try to unmarshal two different version of NegotiationState they both
end up having the exact same value for subStatus which is always the last
one to be unmarshalled:

<?xml version="1.0" encoding="UTF-8"?><negotiation-state
gpk="1"><substatus><substatus-s>substatus.receiving
</substatus-s></substatus></negotiation-state>

<?xml version="1.0" encoding="UTF-8"?><negotiation-state
gpk="2"><substatus><substatus-s>substatus.evaluating
</substatus-s></substatus></negotiation-state>

It seems that since the variable "subStatus" is initialized in the
constructor of NegotiationState (instead of being null) there will be only
one instance of subStatus reused for every instances of
NegotiationState?!?!?!?!?

I've found the explanation of the behaviour here:
http://jibx.sourceforge.net/details/structure-element.html, but still that
doesn't make any sense to me...

Is there any workaround?

Thanks

Christian
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to