I am doing 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 this:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With