views:

423

answers:

1

How can I bind an array parameter in the HQL editor of the HibernateTools plugin? The query parameter type list does not include arrays or collections.

For example:
Select * from Foo f where f.a in (:listOfValues).
How can I bind an array to that listOfValues?

+1  A: 

You probably cannot. Hibernate replaces the objects it gets out of the database with it's own objects (kind of proxies). I would strongly assume Hibernate cannot do that with an array. So if you want to bind the array-data put it into a List on access by Hibernate.

As an example one could do:

select * from Foo f where f.a in f.list
boutta
How do you bind to a List?
ncgz