I am using Oracle database and myBatis as ORM framework, all queries are in XML mapper files. I need to put couple thousand arguments in IN
caluse and I know there is a constraint that only 1000 arguments could be put there. I have decided for solution:
WHERE something IN (a1, a2, ..., a1000)
OR something IN (a1001, a1002, ..., a2000)
OR ...
How could I make that in XML mapper file?
There are <foreach>
, <if>
tags, etc. but I don't find any suitable that can insert SQL code from above into template.
It would be great that something like this can make it work:
<some_tag collection="huge_collection" item="huge_collection[1:1000]>
</some_tag>