Hello Keith,

How does one implement the functionality for referencing the class and not the entire object.

One fo the possible options i looked into was using the identity and the reference attributes .

The example is as ashown:

Mapping file:

<class name="com.dekra.automobil.kasse.pbo.vbsf.PBOVBSFKassenbewegung">
     <map-to xml="PBOVBSFKassenbewegung"/>

<field name="Auftragsposition"
 type="com.dekra.automobil.auftragswesen.pbo.vbsf.PBOVBSFAuftragsposition" collection="array" set-method="addAuftragsposition" get-method="getAuftragsposition">
                        <bind-xml name="Auftragsposition" node="attribute" reference="true"/>

              </field>

</class >

 <class name="com.dekra.automobil.auftragswesen.pbo.vbsf.PBOVBSFAuftragsposition" identity="auftragspositionOID" >
         <map-to xml="Auftragsposition"/>

<field name="auftragspositionOID"
                       type="java.lang.String">
                        <bind-xml name="AuftragspositionOID" node="attribute" />
                </field>

</class >

The idea is just to reference the Auftragpostion onject putting in the auftragpositionOID....and not the whole object...

Thus the result expected of the reference should be:

<Auftragsposition AuftragspositionOID="1019032100338"/>

Please provide with some information on the same.

Thanking you,

regards

Chetan

Chetan Rathi
Augsburger Str.336
70327 Stuttgart
Tel no.0711-7861-3148(off.)
Handy.no.015055564671
 
>From: "Chetan Rathi" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [castor-dev] Unmarshalling:problem
>Date: Tue, 23 Apr 2002 09:29:38 +0000
>


Join the world�s largest e-mail service with MSN Hotmail. Click Here
--- Begin Message ---

Hello Keith,

This is as regards the Unmarshalling of the XML document which in turn is generated by the Castor marshaller.

My Mapping file contents:

<field name="niederlassungsNr"
                       type="java.lang.String" method="getNiederlassungsNr">
                        <bind-xml name="NiederlassungsNr" node="element"/>
                </field>

the above indicates the change in the xml tag as compared to the attribute name in the Java class.

The run time exception for unmarshalling:

org.xml.sax.SAXException: unable to find FieldDescriptor for 'niederlassungsNr' in ClassDescriptor of Auftragsposition

My requirement is the change of the XML tag as above...

Marshalling works fine generating the XML tag...

Unmarshlling retunrs an run time excpetion.The same when changed to the following works:

<field name="niederlassungsNr"
                       type="java.lang.String" method="getNiederlassungsNr">
                        <bind-xml name="niederlassungsNr" node="element"/>
                </field>

How do i handle the above.....i want both the marshalling and the unmarshalling to work.

Regards,

Chetan




Chetan Rathi
Augsburger Str.336
70327 Stuttgart
Tel no.0711-7861-3148(off.)
Handy.no.015055564671
 
>From: chamagne <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Re: [castor-dev] How to map a class that extend another class
>Date: Tue, 23 Apr 2002 10:45:21 +0200
>
>I got a problem when i try to read my class TotoExtend :
>I do a simple request like : "select t from TotoExtend t"
>And i get this message error :
>
>Exception in thread "main" org.exolab.castor.jdo.PersistenceException:
>Requested to load/fetch an object of type TotoExtend, where persistent
>storage returned an object of type class Toto
> at
>org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:553)
>
> at
>org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229)
> at
>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:574)
>
> at
>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:557)
>
>this is my mapping file :
>
>
> Toto
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> totoExtend
>
>
>
>
>
>
> > Simply do the extends-Attribute in the mapping-File:
> >
> >
> >
> >


Chat with friends online, try MSN Messenger: Click Here
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev --- End Message ---

Reply via email to