I am new to Hibernate Criteria , I found many examples using list. Likes to know how a criteria object can be converted to Employee object. Is it possible for Hibernate Criteria to return a class entity.
Employee emp= (Employee) session.createCriteria(Employee.class,"a")
.createAlias("a.jobs", "j")
.add(Restrictions.eq("id", id))
.add(Restrictions.eq("j.active", "1"));
java.lang.ClassCastException: org.hibernate.impl.CriteriaImpl cannot be cast to Employee.
jobs object is one to many relationship, trying to filteractive objects of jobs