tags:

views:

25

answers:

1

How to Iterate List in Ibatis.

query is:

delete from table where (column1='tes10' and column2='NET1' and column3='ENG1') OR (column1='TEST22' and column2='NET2' and column3='ENG2') OR (column1='TEST21' and column2='NET3' and column3='ENG3').

I put column values in map and then i will pass this to ibatis statement asList.Now my question is how can i iterate List so that dyanmic quesry would be loke the above one.

A: 

Here is an example of iterate.

<iterate property="someCollection" open="(" close=")" conjunction=",">
    #someCollection[]#
</iterate>

Let's say we have a string array = {"one","two","three"}.

The result of this iterate method would be,

('one','two','three')

Your case seems awkard, why do you need to compare so many values?

Andy Pryor