I have a query like below
select f.id, s.name, ss.name
from first f
left join second s on f.id = s.id
left join second ss on f.sId = ss.id
If I could use HQL, I would have used HQL constructor syntax to directly populate DTO with the result set. But, since hibernate doesn't allow left join without having an association in place I have to use the Native SQL Query.
Currently I am looping through the result set in JDBC style and populating DTO objects. Is there any simpler way to achieve it?
question from:https://stackoverflow.com/questions/3937131/getting-result-set-into-dto-with-native-sql-query-in-hibernate