ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: Does anyone have any example of "foreach" with annotation
Date Wed, 05 May 2010 15:57:14 GMT
IIRC, iBATIS doesn't support dynamic SQL in annotations.  You'll need
to use an @UpdateProvider and generate the dynamic SQL yourself.

Jeff

On Wed, May 5, 2010 at 2:18 AM, shamim <srecon@yandex.ru> wrote:
>
> Hi All,
>  i have stuck with dynamic Sql on Ibatis 3 annotations. Trying to pass List
> in dynamic sql as follows:
>
> @Update("update ${schemaName}.fuf uf" +
>                        " set uf.reestr_date = #{reestDate}," +
>                        " uf.reestr_number = #{reestNum}" +
>                        " where uf.reestr_number IS not NULL AND uf.reestr_date
IS not NULL and
> uf.id in " +
>                        " <foreach item=\"item\" index=\"index\" collection=\"list\""+
>                        "       open=\"(\" separator=\",\" close=\")\">"+
>                        "       #{item}"+
>                        " </foreach>")
>        void updateUpffReesterByList(@Param("schemaName") final String schemaName,
> @Param("list") List<Long> list, @Param("reestNum") final String reestNum,
> @Param("reestDate") final Date reestDate);
>
> Its always throws JDBC exception. May be i am missing something?
> Thank'x in Advance
>  Shamim
>
>
> --
> View this message in context: http://old.nabble.com/Does-anyone-have-any-example-of-%22foreach%22-with-annotation-tp28457518p28457518.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message