Hi All,
I need little help, I am using Projections for the first time, I am getting Classcast exception, when trying to convert to list.
ClassCastException [Ljava.lang.Object;
Quote:
Criteria c = session.createCriteria(User.class)
.setProjection(Projections.distinct(Projections.projectionList()
.add(Projections.property("userId"), "userId")
.add(Projections.property("userName"), "userName")))
.setResultTransformer(new AliasToBeanResultTransformer(User.class));
List users = c.list();
What I am doing wrong?
Thanks in Advance.