Reputation: 7196
This is my Hibernate namedQuery:
@NamedQuery(name = "getLanguagesForIds", query = "select l from Language l where l.languageId in(:ids)")
When I tried to execute the query, Hibernate is throwing exception:
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
I am passing the language ids as comma separated, like 1,2. Does anyone know how to solve this issue?
Upvotes: 0
Views: 178
Reputation: 273
use List = new ArrayList to hold the ids and pass that as parameter value rather than comma separated string.
Upvotes: 1