after did Query query =hibernate.createSQLQuery("select abc,def from table"); Is it possible to auto "parse" the result to "pojo" list?
so that i can do below
List<CustomPOJO> abc = query.list(); //CustomPOJO is pojo not entity , no @Entity tag
after did Query query =hibernate.createSQLQuery("select abc,def from table"); Is it possible to auto "parse" the result to "pojo" list?
so that i can do below
List<CustomPOJO> abc = query.list(); //CustomPOJO is pojo not entity , no @Entity tag
Try
hibernate.createSQLQuery("select abc,def from table").setResultTransformer(Transformers.aliasToBean(CustomPOJO.class));
like the reference manual suggests.