I got this exception when I tested your suggestion:
[bind] org.jibx.runtime.JiBXException: Field _comp_id not found in class TbScan at
tag "structure"(line 9, col 44, in binding-hawb-status.xml)
It only works if the fields are defined in the TbScan and not in the base class.
Thanks
Anibal
>Okay, I was confused on what you were trying to do in the original
>mapping. Abstract mappings are intended to be extended by other mappings
>and not used directly, and non-abstract mappings need to have an
>associated element name - you were trying to use abstract mappings as
>though they were regular mappings, just without an element name. I don't
>think you need to use mappings in your case, though - you can just put
>everything inline. Here's a cut-and-pasted version of your binding that
>should do what you want (untested, so there may be cut-and-paste errors,
>but it should at least show you the approach):
>
> <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 field="_comp_id"
>type="TbScanPK" >
> <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"/>
> </structure>
> <structure name="status" usage="optional">
> <value field="_dfScananlass"
>name="code" style="attribute"
> usage="optional"/>
> </structure>
> </structure>
> </collection>
> </mapping>
>
>I wouldn't think you actually want the <mapping> to be unordered, but
>left this in since you had it as part of the original version.
>
> - Dennis
>
[EMAIL PROTECTED] wrote:
>I do not want an abstract mapping to extend another abstract mapping.
>There is a structure within the element with another mapping extending an abstract
>mapping.
>These are my classes:
>
>public class TbScan extends BaseTbScan {
> private String unique_id;
> ...
>}
>
>public abstract class BaseTbScan implements Serializable {
> private TbScanPK _comp_id;
> // fields
> private java.lang.Integer _dfScananlass;
> ...
>}
>
>
>public class TbScanPK extends BaseTbScanPK {
> ...
>}
>
>public class BaseTbScanPK implements Serializable {
> private java.lang.String _dfPod;
> private java.lang.Integer _dfPacknr;
> private java.sql.Date _dfScandat;
> private java.sql.Time _dfScantime;
> ...
>}
>
>How can I map this or is not possible?
>
>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
>
>
>
>
--
Dennis M. Sosnoski
Enterprise Java, XML, and Web Services
Training and Consulting
http://www.sosnoski.com
Redmond, WA 425.885.7197
-------------------------------------------------------
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