cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Optimize cascade deletes
Date Sat, 22 Sep 2007 14:16:38 GMT

On Sep 22, 2007, at 4:41 PM, Giulio Cesare Solaroli wrote:
>>> The SQL I am expecting Cayenne to generate would look like this:
>>> delete from user_detail where id_user = <id of the user I want to
>>> delete>;
>> Cayenne 3.0M2 (yet unreleased) supports such functionality via an
>> EJBQL query, but maybe you don't need to do direct DB deletion  
>> just yet.
> Where should I start looking to try to integrate the new revision of
> Cayenne in my project in order to take advantage of this feature?

Here is a few links that should help you to get started:

* Today's nightly build: 
* The jars from the build that you need (cayenne-server.jar +  
* EJBQLQuery documentation: 
* Additional details of EJBQL syntax can be found in the JPA spec,  
Chapter 4: 

Your query may look like this:

   String ejbql = "delete from UserDetail ud where ud.user = :user";
   EJBQLQuery query = new EJBQLQuery(ejbql);
   query.setParameter("user", user);


View raw message