Let's say I have a query that begins with the following projections:
SELECT t.term as term, count(g.id) as amount
This is raw sql, and I am using createSqlQuery on the Hibernate session object. What I'd like to do is take these projections and put them in an object that has a "term" and "amount" properties.
With HQL, we can use "select new ClassName(...)", but this doesn't work with a raw SQL query.
How do we do it? I get back a bunch of [LObject's... and I have no idea what to do with them. If I can get Hibernate to put them into some kind of non-entity value object, that'd be great.
Thanks!