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 Matthias Laube <ml...@gmx.de> on 2003/06/22 13:27:17 UTC
Question: (Automatic) deletion of m:n relations
Hi!
My question is it yet possible to have only the relation (stored in an
indirection table) between two objects deleted automatically?
My class descriptor:
<class-descriptor
class="de.ciber.eprocurement.model.PersonImpl"
table="eproc.person"
>
<field-descriptor
name="_id"
column="id"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
/>
<field-descriptor
name="_companyId"
column="company_id"
jdbc-type="INTEGER"
/>
<field-descriptor
name="firstName"
column="first_name"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="lastName"
column="last_name"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="title"
column="title"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="companyFunction"
column="company_function"
jdbc-type="VARCHAR"
/>
<collection-descriptor
name="addressGroups"
element-class-
ref="de.ciber.eprocurement.model.AddressGroup"
auto-retrieve="true"
auto-update="true"
auto-delete="true"
indirection-table="eproc.address_group_x_person"
>
<fk-pointing-to-this-class column="person_id"/>
<fk-pointing-to-element-class
column="address_group_id"/>
</collection-descriptor>
<reference-descriptor
name="company"
class-ref="de.ciber.eprocurement.model.api.Company"
>
<documentation>this is the reference to the
persons company</documentation>
<foreignkey field-ref="_companyId"/>
</reference-descriptor>
<field-descriptor
name="ojbConcreteClass"
column="ojbConcreteClass"
jdbc-type="VARCHAR"
/>
</class-descriptor>
in the collection-descriptor.
I retrieve the AddressGroups with the Person-Object but when I call
remove on their iterator an update the Person the row in the indirection
table
Is not deleted.
Is it my fault?
Matthias Laube
mlaube@gmx.de