Hi,
See the following mapping
public class SomeClass {
private Integer someField;
}
When i call the following query
select someField, count(*) from SomeClass inner join OtherClass... group by ...
And i proccess the query as follows
Map<Integer, Integer> result = new HashMap<Integer, Integer>();
List<Object> objectList = query.list();
for(Object object: objectList) {
Object [] objectArray = (Object []) object;
result.put((Integer) objectArray[0], (Integer) objectArray[1]);
}
I get ClassCastException: can not convert Long to Integer
Question: what should i do to retrieve the values returned by the HQL as Integer instead of Long ????