Hi,
What I'm trying to ask is if I have this HQL (Join) Query:
Code:
sb.append("select D.defectId, D.description, P.description as Priority, D.reportDateTime as ReportDate, S.userName as
Reporter, FA.areaName as FunctionalArea, ST.description as Status, D.severity as Severity From Defect as D ");
sb.append("JOIN D.stf1 as S ");
sb.append("JOIN D.priorities as P ");
sb.append("JOIN D.statuses as ST ");
sb.append("JOIN D.functionalAreas as FA");
and I have a class called "DisplayDefect" that is created to hold the results and I execute the query like this:
Code:
results = session.createQuery(sb.toString()).list();
What is the easiest way to get the DisplayDefect Class populated with the results?
I think if I use a native query I can just do this:
Code:
results = session.createSQLQuery(sql).addEntity(DisplayDefect.class).list();
and this will give me an array of DisplayDefect Objects . . . and I can do this I suppose but how do I do it if I execute a "non-native" query . . . that is an HQL Query?
Thanks,
Rob