title: Null and Empty Check for a IN Clause parameter for Spring data jpa @query?
body: <p>My Spring data JPA code to get the data from db based on some search criteria is not working. My DB is SQL Server 2012, same query seem to work with MYSQL DB. </p>
  
  <p>Code Example : </p>
  
  <pre><code>@Query(value = "select * from entity e where e.emp_id=:#{#mySearchCriteria.empId} and ((:#{#mySearchCriteria.deptIds} is null or :#{#mySearchCriteria.deptIds} ='') or e.dept_id in (:#{#mySearchCriteria.deptIds})) ", nativeQuery = true)
  public List&lt;Entity&gt; search(@Param("mySearchCriteria") MySearchCriteria mySearchCriteria);
  </code></pre>
  
  <p>if list mySearchCriteria.deptIds  has more than one value- it's not working(it's actually translating it to wrong query. Any lead? Thanks in advance.</p>
  
  <p><strong>Note:  data type for deptIds is List of Integer</strong></p>