Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358436

Summary: RFE: please allow the ability to get a count for a given JPA query
Product: z_Archived Reporter: Laird Nelson <ljnelson>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Laird Nelson CLA 2011-09-21 10:54:47 EDT
Build Identifier: 2.3.0

Many UIs need the ability to get an estimate of the overall size of a domain over which a query ranges so that paging may be implemented.  Consequently it is often necessary in a JPA context to be able to get the estimated domain size for any JPA query.  Usually one does this with a query that uses the COUNT() operator.  There is, however, no reliable way to translate an arbitrary JPQL SELECT query into its SELECT COUNT(x) equivalent.  James Sutherland has proposed adding a getCount() method to JPAQuery that would produce a count of entities matching an arbitrary JPAQuery's criteria.

Reproducible: Always
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:25:11 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink