On 13.05.2009 19:19:14 Andrus Adamchik wrote:
>
> On May 12, 2009, at 4:40 AM, Jeremias Maerki wrote:
>
> > While I'm at it: Can I ask why DeleteQuery has been deprecated? I'd
> > rather use that instead of EJBQLQuery. Not having to concatenate
> > strings
> > to build queries is one of the features that makes Cayenne appeal to
> > me
> > so much. I've had stuff like that back in my Delphi times and I liked
> > that very much.
>
>
> The problem with DeleteQuery (or EJBQL delete for that matter) is that
> it didn't clean up in-memory objects that were deleted in the DB. So
> the feeling was that it is conceptually wrong as a public user API.
> The preferred way is get a hold of an object and do
> context.deleteObject(..).
Thanks for the explanation. I don't see a problem with having special
queries around that don't update the local context. I mean, something
not under Cayenne's control could always access the database directly
and modify things that Cayenne doesn't notice. As long as the user of
the DeleteQuery is aware of its behaviour it is a powerful tool for
certain situations.
> Of course the need for a batch delete operation doesn't completely go
> away with the above. I guess we may need to work on getting it right
> as a part of the planned post 3.0 effort to merge redundant queries
> together and provide them all with a non-String OO creation interface.
That'd be great.
Thanks,
Jeremias Maerki
This archive was generated by hypermail 2.0.0 : Wed May 13 2009 - 14:25:42 EDT