Unidirectional relationship is not support.



Thomas


-----Original Message-----
>From: Dieter Cailliau [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, November 08, 2001 1:49 AM
>To: [EMAIL PROTECTED]
>Subject: [castor-dev] what is wrong with not mapping one side of
many-to-many?
>
>i'm trying to make a many to many relation in one direction.
>Therefore, i map it like a many-to-many, but i remove
>the collection mapping at one of the classes.
>
>Everything goes well, updating correctly changes the x table.
>A problem occurrs when i read the related objects in the
>next program run: castor finds more related objects
>that the x table holds, it's like every previously found
>related role is automatically also related to the accounts
>i read later, which has at least one related role.
>
>Why? Whats wrong with this trick? How can i do it right?
>
>this is the mapping:
>
>  <class name="...Role" identity="identifier">
>    <map-to table="role"/>
>    <field name="identifier" type="integer" direct="true">
>      <sql name="identifier" type="numeric"/>
>    </field>
>    <field name="description" type="java.lang.String" direct="true">
>      <sql name="description" type="varchar"/>
>    </field>
>    <!-- no collection of accounts here -->
>  </class>
>
>  <class name="..Account" identity="identifier" >
>    <map-to table="account"/>
>    <field name="identifier" type="java.lang.String" direct="true" >
>        <sql name="identifier" type="varchar"/>
>    </field>
>    <field name="name" type="java.lang.String" direct="true" >
>        <sql name="name" type="varchar"/>
>    </field>
>    <field name="roles" collection="collection" type="...Role"
direct="true"
>>
>      <sql name="role" many-table="account_role_x" many-key="account"/>
>    </field>
>  </class>
>
>-----------------------------------------------------------
>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