How to pass an Integer Array to IN clause in MyBatis

前端 未结 4 1327
旧巷少年郎
旧巷少年郎 2020-12-01 05:39

There is a query in my Mybatis containing an IN clause which is basically a set of Id\'s ( Integers)

I am now stuck on how can I pass an Integer array to this IN cla

4条回答
  •  -上瘾入骨i
    2020-12-01 05:53

    The myBatis User Guide on Dynamic SQL has an example on how to use a foreach loop to build the query string, which works for lists and arrays.

    Prior to release 3.2 you had to use xml configuration to use dynamic sql, with newer versions it should also be possible to use dynamic sql in annotations.

    
    

提交回复
热议问题