I have a dataobject like
class DocInfo
{
String docId;
String corrId;
String familyId;
}
This maps to a database table.
I’m using a combination of session factory and criteria to execute my query in hibernate which returns the rows that match the query on docId.
Query q = getCurrentSession().createQuery("from DocInfo item where item.docId = :docId");
q.setString("docId", docId);
return q;
Is there a way to directly create a data object out of the results of a query ?
Yes, you can get a list of DocInfo using q.list()