db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Bauman <g...@bravenet.com>
Subject Re: Cascading delete?
Date Mon, 07 Apr 2003 21:18:56 GMT
Okay, so...

 > <table name="CHILD_TABLE">
 >    <column
 >      name="child_id"
 >      required="true"
 >      primaryKey="true"
 >      type="INTEGER"
 >      autoIncrement="true"
 >    />
>   <foreign-key foreignTable="PARENT_TABLE"
>     name="PARENT_TABLE_FK"
>     onDelete="cascade">
>     <reference local="child_id" foreign="parent_id"/>
>   </foreign-key>
 > </table>

... given this example, if I delete or update the OM's ParentTable 
object, the associated records in CHILDTABLE should be deleted, right?

ParentTablePeer.doDelete(ParentTable);

Unfortunately, this does not work for me. The ParentTable record is 
deleted, but the children are not. Perhaps I need to tell the 
ParentTable instance to load its children explicitly? What am I missing?

Also, is there any documentation for the setnull and restrict options?

Thanks...

Gabe


Mime
View raw message