Hi,
I figured out my mistake, the sql key mapping should have the same name in 
the parent and child class :)

so the parent has  xml like 
<field required="false" transient="false" direct="false"
            name="child" lazy="false"
            get-method="getChildAsReference"
            type="Child" set-method="setChild" collection="arraylist">
            <sql many-key="PARENT_ID" dirty="check" read-only="false"/>
            <bind-xml node="element" name="child"/>
        </field>

and the child has xml like 

<field required="false" transient="false" direct="false" type="Parent"lazy="false">
            <sql name="PARENT_ID" dirty="check" read-only="false"/>
            <bind-xml node="element" name="parent"/>
        </field>

thnx
Chavan

On Tue, 11 Feb 2003, chavan wrote:

> Hi,
> I have a Parent class with 1-many relationship with Child class.
> Now when i parse the XML thru the marshaller and create the Parent object 
> using Database.create it stores the children neatly.
> What i want to do is to retrieve all Children for the Parent, my query 
> looks like "Select p from Parent p where p.id = $"..
> 
> this gives me the parent with all it's info but the child Collection is 
> empty :(
> 
> Any pointers will help a lot,
> 
> thnx
> Chavan
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 
> 
> 

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

Reply via email to