Return-Path: Delivered-To: apmail-cayenne-dev-archive@www.apache.org Received: (qmail 47314 invoked from network); 11 Dec 2009 12:51:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Dec 2009 12:51:56 -0000 Received: (qmail 12445 invoked by uid 500); 11 Dec 2009 12:51:55 -0000 Delivered-To: apmail-cayenne-dev-archive@cayenne.apache.org Received: (qmail 12422 invoked by uid 500); 11 Dec 2009 12:51:55 -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 12412 invoked by uid 99); 11 Dec 2009 12:51:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2009 12:51:55 +0000 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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, 11 Dec 2009 12:51:47 +0000 Received: (qmail 8833 invoked from network); 11 Dec 2009 12:51:27 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 11 Dec 2009 12:51:27 -0000 Message-Id: <7C487153-241A-466E-BC78-F1DD4F6D1325@objectstyle.org> From: Andrus Adamchik To: dev@cayenne.apache.org In-Reply-To: <9f90c2b60912110242k167d7994n922b4f8fd8d8605b@mail.gmail.com> Content-Type: text/plain; charset=KOI8-R; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Binding Array in SQLTemplate Date: Fri, 11 Dec 2009 07:51:26 -0500 References: <5adb61290912090812q2f005009g53675184d352160b@mail.gmail.com> <1BA8D7A1-4860-42A5-BFEB-EA405BB0E013@objectstyle.org> <3DEE6BDD7473324C8320C35F924F1DF9050ACA0D@PALLADA.diasoft.ru> <9f90c2b60912110242k167d7994n922b4f8fd8d8605b@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org 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. >> >