Oops..I forgot to change the subject header :)

------------------------------------------------------------------------
------

Hi, 

I am new to Castor and am just feeling my way around. I am trying to
marshall/unmarshall java to xml and am stuck with an example. Would
appreciate any help on this. 

I have two class :

Parent -> one to many Child
-----------------------
Parent: returns Set getChild();
Parent: void addChild(Child c);
........


Child:
--------------------
Child: returns parent getParent;
Child: setParent(Parent p);
........

So you see, they have cyclic reference. I am trying my mapping file as
(I am not sure if it's 
correct at all) 
------------------------------------------------------------------------
----------

<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
                           "http://castor.exolab.org/mapping.dtd";>
<mapping>

    <class name="Parent" identity="id">
        <field name="child" collection="set" type="Child" >
            <bind-xml location="child" name="child" node="element"/>
        </field>
    </class>

</mapping>
------------------------------------------------------------------------
-------------

Can any one pls show me any examples?

Thank
Shishir

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to