Possible Duplicate:
Hibernate HQL: Get count of results without actually returning them
I have a hql query like this
select new map(t.divisionId as divisionId,t.projectId as projectId,t.roleId as roleId,t.userId as userId, t.reference as reference,t.note as note,sum(t.hoursPlanned) as hoursPlanned,sum(t.hoursUnplanned) as hoursUnplanned,sum(t.hoursPlanned) + sum(t.hoursUnplanned) as total) from TimeSheetsWork t where t.divisionId in :_divisions group by t.divisionId,t.userId,t.projectId,t.roleId
i want to get the no of records returned from this query (without actually returning them ).
is there a way in Hibenate to do that ?? Thanx in Advance
If you really need only number of records then u can use count command rather than creating map in the query like :