I encountered a very urgly problem when I's trying to count the number of records using Hibernate. By debuging I get the HQL and related error:
HQL:
SELECT COUNT(id) AS totalSize FROM UserAccount WHERE 1 = 1 AND role IN (:role_list) AND agent.id = :agentId
Set Parameter:
query.setParameter("role_list", parameter.getRoles());
query.setParameter("agentId", parameter.getAgentId());
Error:
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Integer
I'm confused with that since It worked fine previously when I set its parameter with sequence instead of name. Can anybody give me ideas for that.
Thanks in advance.