How can I deal with this problem ?

Is self-referencing relationships planed to be supported ?

Vincent

-----Message d'origine-----
De : Bruce Snyder [mailto:[EMAIL PROTECTED]] 
Envoye : mercredi 3 juillet 2002 16:25
A : [EMAIL PROTECTED]
Objet : Re: [castor-dev] Removing elements...


This one time, at band camp, Vincent Lambert said:

VL>When I remove a category that contains only items, it works fine : it

VL>deletes the category and the contained items. When I remove a 
VL>category that contains items and empty category, it works fine too : 
VL>it deletes the category and the contained elements.
VL>
VL>But when I try to delete a category that contains category that 
VL>contains elements, it does not recurse into the tree structure.
...
VL> <class name="com.eurelis.webtools.catalog.Category"
VL>identity="Id" key-generator="IDENTITY">
VL>     <description>Category definition</description>
VL>     <map-to table="category"/>
VL>     <field name="Id" type="string">
VL>         <sql name="id" type="integer"/>
VL>     </field>
VL>     <field name="IdCategory" type="string">
VL>         <sql name="id_category" type="integer"/>
VL>     </field>
VL>     <field name="Name" type="string" >
VL>         <sql name="name" type="varchar"/>
VL>     </field>
VL>     <field name="Items" type="com.eurelis.webtools.catalog.Item" 
VL>collection="vector">
VL>         <sql name="id" many-table="item" many-key="id_category"/>
VL>     </field>
VL>     <field name="Categories"
VL>type="com.eurelis.webtools.catalog.Category" collection="vector">
VL>         <sql name="id" many-table="category"
VL>many-key="id_category"/>
VL>     </field>
VL> </class>

Vincent, 

Castor does not support self-referencing relationships. You're mapping a
Category object to a Category object. It's mapping an object of type
Category to an object of type Category. This is a self-referencial
relationship.

Bruce
-- 
perl -e 'print
unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
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