title: How can I make a named query with IN actually work?
body: <pre><code>class X {
  Y y; // manyToOne
  }
  class Y {
  Long id;
  }
  </code></pre>
  
  <p><br></p>
  
  <pre><code>@NamedQuery(name = "someName", query = "from X where y.id in :ids")
  </code></pre>
  
  <p>I have public, table, entity and all other things on the Entities but I didn't wrote them here.</p>
  
  <pre><code>TypedQuery&lt;X&gt; query = getEntityManager().createNamedQuery("someName", X.class);
  query.setParameter("ids", someListOfLongs); // HERE I GET THE ERROR
  queryFinal.getResultList();
  </code></pre>
  
  <p><br>
  <code>Parameter value [[Ljava.lang.Object;@90d0bf] was not matching type [java.lang.Long]</code></p>
  
  <p>I tried with or without (), I changed the version of Hibernate-Core to 3.6.4 (from JBoss 6.0.0.Final), otherwise if I wrote <code>in :ids</code> without () I'd got an error.</p>
  
  <p>Please Help.</p>
  
  <p><br>
  <code>The IN always worked, the problem was that List&lt;Long&gt; wasn't actually List&lt;Long&gt; was List&lt;Object[]&gt;. Thanks</code></p>