Hello,

I'd like to know if anybody has a simple xml mapping file with a one to many
relationship...Mine does not working and I really don't know why.

My mapping is (one Prod has many ProdDetails:

<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
                           "http://castor.exolab.org/mapping.dtd";>
<mapping>
        <class name="cka.Prod" identity="id" access="shared">
                <map-to table="prod" /> 
                        <field name="id" type="integer" required="false"
direct="false" lazy="false">
                                <sql name="id" type="integer" dirty="check"
/> 
                        </field>
                        <field name="name" type="string" required="false"
direct="false" lazy="false">
                                <sql name="name" type="char" dirty="check"
/> 
                        </field>
                        <field name="price" type="integer" required="false"
direct="false" lazy="false">
                                <sql name="price" type="integer"
dirty="check" /> 
                        </field>
                        <field name="groupId" type="integer"
required="false" direct="false" lazy="false">
                                <sql name="groupId" type="integer"
dirty="check" /> 
                        </field>
                        <field name="ProdDetails" type="cka.ProdDetail"
required="false" collection="collection" >
                                <sql many-key="prod_id" />
                        </field>
</class>

<class name="cka.ProdDetail" identity="id" depends="cka.Prod"
access="shared">
                <map-to table="Prod_Detail" /> 
                        <field name="name" type="string" required="false">
                                <sql name="name" type="char" dirty="check"
/>
                        </field>
        </class>
</mapping>

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

Reply via email to