cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Ryabitskiy <evgeny.ryabits...@gmail.com>
Subject Re: Binding Array in SQLTemplate
Date Fri, 11 Dec 2009 10:42:07 GMT
No answer...
But history  points to Andrus :)

Evgeny.

10 декабря 2009 г. 10:55 пользователь Рябицкий Евгений
<eryabitskiy@diasoft.ru> написал:
> Hello!
> I try to use array (like String[]) as a bind parameter.
>
> In follow lines:
>
>        String[] artistNames = new String[2];
>        artistNames[0] = "Artist1";
>        artistNames[1] = "Artist3";
>        String sql = "SELECT * FROM ARTIST WHERE ARTIST_NAME in (#bind($ARTISTNAMES))";
>        SQLTemplate query = new SQLTemplate(Artist.class, sql);
>        query.setParameters(Collections.singletonMap("ARTISTNAMES", artistNames));
>        List result = getDomain().createDataContext().performQuery(query);
>
> I got this query in logs:
>
> INFO: SELECT * FROM ARTIST WHERE ARTIST_NAME in (?) [bind: 1:< 'Artist1','Artist3'>]
> 10.12.2009 10:48:09 org.apache.cayenne.access.QueryLogger logSelectCount
> INFO: === 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 it should be used?
>
> Evgeny.
>

Mime
View raw message