Hello everyone,
I am using Hibernate(3.2) Criteria for querying and its giving me exception when converting to a list.
Please see my code and exception below:
List<Summary> summaryList;
Criteria criteria = session.createCriteria(Summary.class);
session.beginTransaction();
summaryList = Criteria.setProjection(Projections.projectionList().add(Projections.sum("contractDollar")) .add(Projections.groupProperty("department"))).list() ;
exception: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.abc.model.Summary
I am not sure why the result is returned as 'Object' even though I specified it as my pojo(Summary)
Could you please help me with this. I am a newbie to hibernate.
Thanks, Raja Chandra Rangineni.
|