title: Spring Data JPA repositories: IN-clause in derived query not working
body: <p>I have a repository that looks like this:</p>
  
  <pre><code>public interface UserRepository extends JpaRepository&lt;User, Long&gt;
  {
      User findByEmailIgnoreCase(String email);
  
      @Query("select u from User u where u.id in (:ids)")
      Set&lt;User&gt; getByIdInSet(@Param("ids") Set&lt;Long&gt; ids);
  }
  </code></pre>
  
  <p>When I call <code>getByIdInSet</code> I get the following error:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: You have attempted to set a value of type class org.eclipse.persistence.indirection.IndirectSet for parameter ids with expected type of class java.lang.Long from query string select u from User u where u.id in (:ids).
      at org.eclipse.persistence.internal.jpa.QueryImpl.setParameterInternal(QueryImpl.java:933)
      at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(EJBQueryImpl.java:593)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
  </code></pre>
  
  <p>Apparently I don't know what means because I have tried changing all sorts of data types and still get the same error. The set of ids I am passing contains just one id. Please point me in the right direction.</p>