Cascading Deletes

1 view
Skip to first unread message

Derek Wueppelmann

unread,
Jan 16, 2009, 2:49:55 PM1/16/09
to rose-db...@googlegroups.com
Hello again,

I've run into a bit of an issue with the way I have my system setup. I
require to run an extra bit of code prior to deleting an object, however
I don't see any way to add a trigger into the deletion process. Is
something like this possible? I want to add some extra logic into the
deletion process prior to the initial object being deleted from the
database.

John Siracusa

unread,
Jan 16, 2009, 3:09:50 PM1/16/09
to rose-db...@googlegroups.com

For a single-object delete, you could override delete() in your RDBO
class and add your code before calling SUPER::delete(...). For
mass-delete where RDBO issues queries like "DELETE FROM abc WHERE ..."
the only place to hook into the delete process is from within the
database using triggers.

-John

Derek Wueppelmann

unread,
Jan 16, 2009, 3:12:49 PM1/16/09
to rose-db...@googlegroups.com
On Fri, 2009-01-16 at 15:09 -0500, John Siracusa wrote:
> For a single-object delete, you could override delete() in your RDBO
> class and add your code before calling SUPER::delete(...). For
> mass-delete where RDBO issues queries like "DELETE FROM abc WHERE ..."
> the only place to hook into the delete process is from within the
> database using triggers.

Thanks.. I had just realized that I could override the delete method.
That seems to have done the trick.. Thanks for getting back so quickly.

I have to say the more I use RDBO, the more I like it.


Reply all
Reply to author
Forward
0 new messages