After messing around with it a bit, it does feel quite powerful...now I don't have have to keep a separate class of sql/hql string constants :)
I seem to be getting a ClassCastException still... java.lang.String cannot be cast to java.lang.Integer.
org.hibernate.type.IntegerType.set(IntegerType.java:41)...
points to line 147 of my code which is the list() method applied at the end of my query...
Code:
List someList = session.createCriteria(LocationStats.class)
.add(Restrictions.eq("salaryId", salary))
.add(Restrictions.in("metroArea.id", metroAreas))
.list() //LINE 147
salaryId is an int; metroArea.id is an int; metroAreas is a list of integers. So i'm not seeing where the String comes in.
I've also tried changing the list to a String, and my metroArea.id parameter to a String, but the same problem occurs.