cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: delete from ... where ... in (...)
Date Fri, 30 May 2008 14:13:43 GMT
Don't remember off-hand (this was certainly possible with Cayenne  
'classic' expressions). Could you give it a try?

Andrus

On May 30, 2008, at 4:53 PM, Borut Bolčina wrote:

> Hi,
>
> EJBQLQuery delete = new EJBQLQuery("delete from Artist a where a.id  
> in (1,
>> 2, 3)");
>
>
> this looks more promising. It would be better this way (IMHO):
>
> context = // assume this exists
> List<Integer> myArtistList = // assume this exists
> EJBQLQuery delete = new EJBQLQuery("delete from Artist a where a.id in
> :myArtistList");
> delete.setParameter("myArtistList", myArtistList);
> context.performNonSelectingQuery(deleteQuery);
>
> Is this possible? Or, would it be?
>
> Thanks,
> Borut
>
> 2008/5/30 Andrus Adamchik <andrus@objectstyle.org>:
>
>> See my other reply - there is actually an EJBQL delete.
>>
>>
>>
>> On May 30, 2008, at 4:27 PM, Borut Bolčina wrote:
>>
>> Hi,
>>>
>>> what is the C3M4 prefered way of doing this SQL equivalent: DELETE  
>>> FROM
>>> Artist WHERE Oid IN (1,4,8,9);
>>>
>>> Thanks,
>>> Borut
>>>
>>
>>


Mime
View raw message