It's also not in the <mapping> details, but you should use the extends="" attribute for any abstract mapping to say what the base class is, at least if you want it to work properly when unmarshalling. Take a look at the tutorial description of abstract mappings and follow the examples there for best results at present.
- Dennis
Rego-Dacal, Anibal wrote:
I want to use an abstract mapping with a value element with the attribute style,
which I extend in another mapping,
but when I marshal the class I get many attributes in the xml.
This is my mapping :
<mapping name="hawbs" class="States" ordered="false">
<value field="agent" name="agent" usage="optional"/>
<collection field="statusList" usage="optional">
<structure name="hawb_status" type="TbScan">
<value field="unique_id" name="unique_id" style="attribute"
usage="optional"/>
<structure map-as="BaseTbScan"/>
</structure>
</collection>
</mapping>
<mapping class="BaseTbScanPK" abstract="true">
<value style="attribute" field="_dfPod" name="id" get-method="getDfPod"/>
<value field="_dfPacknr" name="piece_no" usage="optional"/>
<value field="_dfScandat" name="date" usage="optional"/>
<value field="_dfScantime" name="time" usage="optional"/>
</mapping>
<mapping class="BaseTbScan" abstract="true">
<structure field="_comp_id" type="TbScanPK" >
<structure map-as="BaseTbScanPK"/>
</structure>
<structure name="status" usage="optional">
<value field="_dfScananlass" name="code" style="attribute"
usage="optional"/>
</structure>
</mapping>
And this is the result:
<?xml version="1.0"?>
<hawbs>
<agent>XXX</agent>
<hawb_status unique_id="24083" id="724604" id="724604" id="724604" id="724604">
<piece_no>1</piece_no>
<date>2004-04-10</date>
<time>12:30:00</time>
<status code="42"/>
</hawb_status>
</hawbs>
Where is the error or is it a bug?
Thanks
Anibal
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users
