ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arora, Parvinder" <PA0...@att.com>
Subject Question about iterate tag
Date Tue, 20 Nov 2007 00:27:24 GMT
Hello all,

 

I just wanted to clarify a doubt before I start coding

 

I have a POJO 

 

Class foo {

String Id1

String Id2

String Id3

}

 

My query is 

 

Select value1, value2 from temp

Where temp.id1 in (comma separated values)

AND temp.id2 in (comma separated values)

AND temp.id3 in (comma separated values)

 

So based upon the tutorial, the statement id should be something like
this?

 

    <statement id="tempQuery"  cacheModel="mycache"
resultMap="myResultMap" >

    <![CDATA[Select value1, value2 from temp

Where temp.id1 in ]]>

                        <iterate property="fooList" open="(" close=")"
conjunction=",">

             #fooList[].Id1#

            </iterate>

    <![CDATA[ and temp.id2 in ]]>

            <iterate property="fooList"  open="(" close=")"
conjunction=",">

             #fooList[].Id2#

            </iterate>

    <![CDATA[ and temp.id3 in ]]>

            <iterate property="fooList"  open="(" close=")"
conjunction=",">

             #fooList[].Id3#

            </iterate>

    </statement>

 

 

Thanks in advance for your help

 

~Parvinder


Mime
View raw message