@NamedQueries( { @NamedQuery(name = "GetAvailableProducts", query = "FROM Product p WHERE p.type= :type AND (p.available IN (:availableCollection) OR p.available = :available)", }
and then in the code for sleep mode:
query.setParameterList('availableCollection', yourCollection);
EDIT
In jpa you write
query.setParameter('availableCollection', yourCollection);
and according to this it should work.
Tadeusz kopec
source share