Return-Path: Delivered-To: apmail-cayenne-dev-archive@www.apache.org Received: (qmail 48460 invoked from network); 11 Dec 2009 12:57:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Dec 2009 12:57:08 -0000 Received: (qmail 17301 invoked by uid 500); 11 Dec 2009 12:57:07 -0000 Delivered-To: apmail-cayenne-dev-archive@cayenne.apache.org Received: (qmail 17262 invoked by uid 500); 11 Dec 2009 12:57:07 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 17252 invoked by uid 99); 11 Dec 2009 12:57:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2009 12:57:07 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [89.20.34.134] (HELO mail.diasoft.ru) (89.20.34.134) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2009 12:57:05 +0000 Received: by inmail.diasoft.ru (Postfix, from userid 100) id 5D8A34F866; Fri, 11 Dec 2009 15:56:15 +0300 (MSK) Received: from mail.diasoft.ru (mail.diasoft.ru [10.1.2.201]) by inmail.diasoft.ru (Postfix) with SMTP id 1F4DE4F875 for ; Fri, 11 Dec 2009 15:56:15 +0300 (MSK) Received: (qmail 21120 invoked from network); 11 Dec 2009 12:56:35 -0000 Received: from pallada-n1.diasoft.ru (HELO PALLADA.diasoft.ru) (10.1.2.71) by 0 with SMTP; 11 Dec 2009 12:56:35 -0000 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Subject: RE: Binding Array in SQLTemplate Date: Fri, 11 Dec 2009 15:56:05 +0300 Message-ID: <3DEE6BDD7473324C8320C35F924F1DF905107916@PALLADA.diasoft.ru> In-Reply-To: <7C487153-241A-466E-BC78-F1DD4F6D1325@objectstyle.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Binding Array in SQLTemplate Thread-Index: Acp6YMkajGs6L2FZQ+OgFEiKdnnCDgAADpzQ References: <5adb61290912090812q2f005009g53675184d352160b@mail.gmail.com> <1BA8D7A1-4860-42A5-BFEB-EA405BB0E013@objectstyle.org> <3DEE6BDD7473324C8320C35F924F1DF9050ACA0D@PALLADA.diasoft.ru> <9f90c2b60912110242k167d7994n922b4f8fd8d8605b@mail.gmail.com> <7C487153-241A-466E-BC78-F1DD4F6D1325@objectstyle.org> From: =?koi8-r?B?8tHCycPLycog5dfHxc7Jyg==?= To: Ok. I have same thoughts, but was surprised by this result and didn't find = any word about arrays binding in docs... So I'm creating an issue. Evgeny. =20 -----Original Message----- From: Andrus Adamchik [mailto:andrus@objectstyle.org]=20 Sent: Friday, December 11, 2009 3:51 PM To: dev@cayenne.apache.org Subject: Re: Binding Array in SQLTemplate Ah good catch. Looking at the BindDirective code, it doesn't properly =20 support arrays, only collections. I guess we need to change that and =20 treat arrays the same way. Andrus On Dec 11, 2009, at 5:42 AM, Evgeny Ryabitskiy wrote: > No answer... > But history points to Andrus :) > > Evgeny. > > 10 =C4=C5=CB=C1=C2=D2=D1 2009 =C7. 10:55 = =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 =F2=D1=C2=C9=C3=CB=C9=CA = =E5=D7=C7=C5=CE=C9=CA > =CE=C1=D0=C9=D3=C1=CC: >> Hello! >> I try to use array (like String[]) as a bind parameter. >> >> In follow lines: >> >> String[] artistNames =3D new String[2]; >> artistNames[0] =3D "Artist1"; >> artistNames[1] =3D "Artist3"; >> String sql =3D "SELECT * FROM ARTIST WHERE ARTIST_NAME in =20 >> (#bind($ARTISTNAMES))"; >> SQLTemplate query =3D new SQLTemplate(Artist.class, sql); >> query.setParameters(Collections.singletonMap("ARTISTNAMES", =20 >> artistNames)); >> List result =3D =20 >> getDomain().createDataContext().performQuery(query); >> >> I got this query in logs: >> >> INFO: SELECT * FROM ARTIST WHERE ARTIST_NAME in (?) [bind: 1:< =20 >> 'Artist1','Artist3'>] >> 10.12.2009 10:48:09 org.apache.cayenne.access.QueryLogger =20 >> logSelectCount >> INFO: =3D=3D=3D returned 0 rows. - took 0 ms. >> >> >> So... What does it mean? [bind: 1:< 'Artist1','Artist3'>] ? >> I mean what is a purpose of using array in bind? For what queries =20 >> it should be used? >> >> Evgeny. >> >