Hi,
I have an unidirectionnal 1:1 association between two objects : IndividuDTO and
IndBacDTO
<class-descriptor
class="org.udb.candisup.back.dto.domain.IndividuDTO"
table="INDIVIDU"
>
....
....
<field-descriptor
name = "idBac"
column = "cod_ind_bac"
jdbc-type="INTEGER"
conversion
="org.apache.ojb.broker.accesslayer.conversions.Int2IntegerFieldConversion"
/>
<reference-descriptor
name = "bacIndividu"
class-ref = "org.udb.candisup.back.dto.domain.BacIndividuDTO"
auto-update = "true"
auto-delete = "true" >
<foreignkey field-ref="idBac"/>
</reference-descriptor>
....
....
</class-descriptor>
Somewhere in my code, I do this :
IndividuDTO individu = broker.getObjectByQuery(...); //Retrieve the IndividuDTO
individu.setIdBac( 0 );
individu.setBacIndividu( null );
broker.store(individu);
I want that the old BacIndividuDTO to be deleted into the database. Do I have to
delete it explicitelly or is there a way to delete it automatically ??
Thanks
Vincent