IBatis uses set for resultMap and also parameterMap

I want to pass a rowset in an iBatis query for a parameter map, and also return a rowset for a result set.

Is it possible?

Request examples ...

SELECT * FROM some_table t WHERE t.some_column IN (values);

UPDATE some_table t SET t.some_column = 'some_value' WHERE t.other_column IN (values);

      

Walter

+2


a source to share


2 answers


If you want to pass a list of strings as one parameter, for example to build a query IN(val1,val2...)

, you should read about dynamic queries, in particular Iterate . Cm. .



+1


a source


There SqlMapClientTemplate

is a method to return to queryForList

.



With regard to the setting Set

of String

as a parameter, I do not know if it handles iBatis; we built an object for this, and when I ran into this problem it was in the sql expression in

, so I did a comma separated values ​​loop.
Or you can convert Set

to HashMap

and pass this.

0


a source







All Articles