ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashish Kulkarni" <ashish.kulkarn...@gmail.com>
Subject Re: Dynamic Mapped Statements and Iterate question
Date Sun, 16 Sep 2007 18:08:36 GMT
Hi
I got it working

this is how i defined

<parameterMap id="getNotesMap" class="java.util.HashMap">
    <parameter property="view" javaType="java.lang.String" />
    <parameter property="notes" javaType="java.util.List" />
</parameterMap>

<select id="getNotesForScheduling" resultClass="java.util.HashMap"
                                            parameterMap="getNotesMap">

select * from table
<dynamic prepend="where">
      <iterate prepend="AND" property="notes" open="(" close=")"
                       conjunction="OR">
               code=#notes[]#
      </iterate>
and view =#view#
</dynamic>

</select>

</select>

On 9/16/07, Richard Yee <ryee@cruzio.com> wrote:
>
> Ashish,
> Did you read the documentation? What have you tried so far?
>
> -Richard
>
>
> Ashish Kulkarni wrote:
> > Hi
> > I have a question about using Dynamic Mapped Statements and Iterate tag
> >
> > I have a table with columns,
> > view
> > code
> > color
> >
> > I have an sql statement like below which i have to convert to dynamic
> > mapped statement
> >
> > select color from table where view=? and code in (?,?,?)
> >
> > But the code in must be dynamic, for example user may select 3 code,
> > or 100 code from the jsp select page.
> >
> > How do i convert the above statement into Dynamic Mapped Statement, (
> > There are 2 input parameters, view and code)
> >
> >
> > Ashish
> >
> >
>
>

Mime
View raw message