You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Dave Lamy <da...@gmail.com> on 2009/05/20 17:56:12 UTC

Determining objects affected by a delete

When an object is deleted via the UI, I would like to be able to report back
all objects that were affected by the delete, especially objects that were
deleted by cascade rules.  What is the best way to determine this affected
set?  Thanks in advance for any insight on this.

Dave

Re: Determining objects affected by a delete

Posted by Andrey Razumovsky <ra...@gmail.com>.
Hi Dave,

Probably the easiest way to archieve that is to save
ObjectContext.deletedObjects() collection before deletion and compare it to
collection returned by same method after deletion. This will work if your
context isn't touched by several threads.

Andrey

2009/5/20 Dave Lamy <da...@gmail.com>

> When an object is deleted via the UI, I would like to be able to report
> back
> all objects that were affected by the delete, especially objects that were
> deleted by cascade rules.  What is the best way to determine this affected
> set?  Thanks in advance for any insight on this.
>
> Dave
>