I am using 2.1.3 and have a question about using new in an HQL select. My NameDTO is not mapped which is what I want. Is it possible to use the NameDTO constructor without the NameDTO package name (refapp.NameDTO)? I have been searching the forum half the day and can't find an answer. This has got to be a really common question so I appologize if it is already answered.
String query = "select new refapp.NameDTO(mbr.mbrId, mbr.firstName,mbr.lastName) from Mbr as mbr";
Session s = HibernateUtil.currentSession();
Transaction tx = null;
List caseInfos = null;
try
{
caseInfos = s.find(query);
}
catch (Exception e)
{
if (tx!=null) tx.rollback();
s.close();
throw e;
}
finally
{
HibernateUtil.closeSession();
}
Thanks,
Bill
|