Retrieving results count

What is the best way to retrieve the results COUNT of a query that was performed using the generated Criteria or Factory classes?
Jean

What is the best way to retrieve the results COUNT of a query that was performed using the generated Criteria or Factory classes? Is there anyway to do this without loading everything into an array using the ‘list’ functions.
Jean

Hi jvence,

Now you can get the count from the list or write the query directly.

Best regards,
Jick

String HQL = "select count(*) from User"
Quey query = session.createQuery(HQL);
query.execute();
then get the count result
easy. try more don’t depend on the DBVA. Maybe use Spring + Hibernate