class X {
Y y; // manyToOne
}
class Y {
Long id;
}
@NamedQuery(name = "someName", query = "from X where y.id in :ids")
I have public, table, entity and all other things on the Entities but I didn’t wrote them here.
TypedQuery<X> query = getEntityManager().createNamedQuery("someName", X.class);
query.setParameter("ids", someListOfLongs); // HERE I GET THE ERROR
queryFinal.getResultList();
Parameter value [[Ljava.lang.Object;@90d0bf] was not matching type [java.lang.Long]
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 in :ids without () I’d got an error.
Please Help.
The IN always worked, the problem was that List<Long> wasn't actually List<Long> was List<Object[]>. Thanks
I also use JBoss AS 6 and this exact construct, but it just works.
This is an example of a query:
And of a class using it:
As your exception indicated
[[Ljava.lang.Object;@90d0bf](which is an Object[]), maybe you should try List<Long> as in my example?(p.s. You can use the fluid API of JPA to make your code a little less verbose)