I want to get the count of the results of a dynamically-generated HQL query, without actually getting the list of results. Say that the query I have is something like:
you can get the count of the query result by using:
criteria.setProjection(Projections.rowCount()); count=(Long) criteria.uniqueResult();
hope this helps