You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Koller KrisztiƔn <ko...@vnet.hu> on 2003/05/07 08:08:04 UTC
mapping m:n associations, auto-delete="true"
Hi
My english is verry bad. Sorry because of this. :)
I have 2 classes:
the respository.xml:
<class-descriptor class="class_one" proxy="dynamic" table="table_one">
<field-descriptor autoincrement="true" column="id" id="1" jdbc-type="INTEGER" name="id" primarykey="true"/>
<collection-descriptor auto-delete="true" auto-retrieve="true" auto-update="true" element-class-ref="class_two" indirection-table="table_class_one_and_two" name="elements_of_class_two">
<fk-pointing-to-this-class column="id_class_one"/>
<fk-pointing-to-element-class column="id_class_two"/>
</collection-descriptor>
</class-descriptor>
<class-descriptor class="class_two" proxy="dynamic" table="table_two">
<field-descriptor autoincrement="true" column="id" id="1" jdbc-type="INTEGER" name="id" primarykey="true"/>
</class-descriptor>
if I delete one element of class_one ojb will delete some rows of the indirection-table too (table_class_one_and_two), it's ok, I want this, but class_two elements (in table_two) will be deleted too by ojb and it's bad for me. (I need those rows :)) What can I do?
I try to use auto-delete="false", but it isn't good for me, because if I use this option, ojb will not delete any of the elements of the two classes if the classes are connected by the indirection table (table_class_one_and_two).
Thank you!
Chris