You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Channing Walton <ch...@mac.com> on 2002/08/15 20:53:42 UTC

Do torque cascade deletes work

Hi,
I have a couple of 1:n relationships between a class (Foo for arguments
sake) and some other classes.

I would like instances of the other classes to be deleted when an instance
of Foo is deleted.

I thought that I could use the onDelete=²cascade² attribute in my
foreign-key reference, but the generated code is unchanged after rebuilding
the OM with torque. Is the onDelete thing working?

Or is it better not to use torque for this but to do it manually myself?

Channing 

Here is the type of thing I have:

<table name="FOO">
      <column name="FOO_ID" required="true" autoIncrement="true"
        primaryKey="true" type="INTEGER"/>
</table>

<table name="SUB">
    ...
    <column name="FOO_ID" required="true" type="INTEGER"/>
    <foreign-key foreignTable="FOO" onDelete="cascade">
      <reference local="FOO_ID" foreign="FOO_ID"/>
    </foreign-key>
</table>
-- 
Channing Walton
http://homepage.mac.com/channingwalton


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Do torque cascade deletes work

Posted by Channing Walton <ch...@teaminabox.co.uk>.
On 15/8/02 10:06 pm, "Stephen Haberman" wrote:

>> Or is it better not to use torque for this but to do it manually
> myself?
> 
> Yeah, you'll have to do it manually yourself.
> 

OK thanks Stephen. As an aside, I have read that some DBAs prefer that such
magic is done in the database and not in the app - I have no idea why.

Channing


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Do torque cascade deletes work

Posted by Stephen Haberman <st...@chase3000.com>.
> Or is it better not to use torque for this but to do it manually
myself?

Yeah, you'll have to do it manually yourself.

I'm not sure where the onDelete came from; I've been working on Torque
for awhile and just now noticed it. It looks to be cool functionality,
but I can't tell you why it's not implemented off the top of my head.

- Stephen


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>