Normally reports don't use managed objects, just scalars. Reports tend to deal with large numbers of rows, or at least larger numbers than you'd normally deal with for on-screen queries, so saving memory is good, and also saving the time required to build managed objects. They're also usually fire-and-forget: you don't need links to other objects, row identifiers, or anything other than the data you'll be printing. So usually, HQL's select new syntax is enough (if you want to put each row into a bean-like object), or else you could use an sql-query with the required columns defined using return-scalar elements.
select new is described in the ref docs, section 14.5. sql-query and return-scalar are in section 16.3.
_________________ Code tags are your friend. Know them and use them.
|