Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 89065 invoked from network); 30 May 2008 14:14:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 May 2008 14:14:20 -0000 Received: (qmail 73032 invoked by uid 500); 30 May 2008 14:14:16 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 73025 invoked by uid 500); 30 May 2008 14:14:16 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 73006 invoked by uid 99); 30 May 2008 14:14:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 07:14:16 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 30 May 2008 14:13:28 +0000 Received: (qmail 23807 invoked from network); 30 May 2008 14:13:44 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 30 May 2008 14:13:44 -0000 Message-Id: <682B6EF4-D542-49E2-BDFC-3E155F1A7BDB@objectstyle.org> From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: delete from ... where ... in (...) Date: Fri, 30 May 2008 17:13:43 +0300 References: X-Mailer: Apple Mail (2.924) X-Virus-Checked: Checked by ClamAV on apache.org Don't remember off-hand (this was certainly possible with Cayenne =20 'classic' expressions). Could you give it a try? Andrus On May 30, 2008, at 4:53 PM, Borut Bol=C4=8Dina wrote: > Hi, > > EJBQLQuery delete =3D new EJBQLQuery("delete from Artist a where a.id =20= > in (1, >> 2, 3)"); > > > this looks more promising. It would be better this way (IMHO): > > context =3D // assume this exists > List myArtistList =3D // assume this exists > EJBQLQuery delete =3D 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 : > >> See my other reply - there is actually an EJBQL delete. >> >> >> >> On May 30, 2008, at 4:27 PM, Borut Bol=C4=8Dina wrote: >> >> Hi, >>> >>> what is the C3M4 prefered way of doing this SQL equivalent: DELETE =20= >>> FROM >>> Artist WHERE Oid IN (1,4,8,9); >>> >>> Thanks, >>> Borut >>> >> >>