title: How to pass an Integer Array to IN clause in MyBatis
body: <p>There is a query in my Mybatis containing an IN clause which is basically a set of Id's ( Integers)</p>
  
  <p>I am now stuck on how can I pass an Integer array to this IN clause so that it pulls up the proper records.Tried by passing a String containing the ID's to the IN clause , but this did not work as expected.</p>
  
  <p>Code Sample below</p>
  
  <p>Mybatis Method using Annotations</p>
  
  <pre><code>@Select(SEL_QUERY)
      @Results(value = {@Result(property="id",column="ID")})
      List&lt;Integer&gt; getIds(@Param("usrIds") Integer[] usrIds);
  </code></pre>
  
  <p>Query</p>
  
  <pre><code>select distinct ID from table a where a.id in ( #{usrIds} )
  </code></pre>
  
  <p>Method Call</p>
  
  <pre><code>Integer[] arr = new Integer[2];
  arr[0] = 1;
  arr[1] = 2;
  
  mapper.getIds(arr)
  </code></pre>
  
  <p>This is not working , Mybatis throws an error when I call the mapper method</p>
  
  <p>Any suggestions please</p>