I have this class Award mapping the Award table that has a lots of columns(30). When I do list awards I don't need more than few things (id, description) if I use a projection sql-query like below that will do it.
If I use hql that is way too slow because the extra work perform to fetch 30 columns per award.
Is lazy="true" on the field working ? Is there any other (better) way of doing ?
Code:
<sql-query name="award.listing">
<return alias="entry" class="Award"/>
<![CDATA[
SELECT
cpa.award_id as {entry.id},
cpa.description as {entry.description},
FROM ,
award cpa
]]>
</sql-query>
[/code]