I would like to convert a hibernate query (HQL) into a query that performs 
a select count(*) ...

I have the following code in a pull request:

https://github.com/terrywbrady/DSpace/blob/ds-2583v7/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java#L135-L195

This code constructs a DSpace metadata query.  The query might return a 
small number of objects or a large number of objects.  

In order to manage the number of results that are returned, I set an offset 
and a limit to the query and paginate the results.

https://github.com/terrywbrady/DSpace/blob/ds-2583v7/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java#L136-L137

It would be useful to compute a count of total results.  Is there a proper 
way to construct a hibernate query (HQL) that will return a count of total 
results in an efficient manner.

I would like to reuse as much of the HQL as possible without triggering the 
construction of results when I am only seeking a count.

Terry

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to