Package com.blazebit.persistence
Interface PaginatedTypedQuery<T>
-
- Type Parameters:
T
- the return type of elements
- All Superinterfaces:
javax.persistence.Query
,javax.persistence.TypedQuery<T>
public interface PaginatedTypedQuery<T> extends javax.persistence.TypedQuery<T>
An extended version of a TypedQuery which also provides access to a count query.- Since:
- 1.2.0
- Author:
- Christian Beikov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<T>
getPageResultList()
Returns the result list of the page without executing a count query.PagedList<T>
getResultList()
Returns aPagedList
containing the result list of the requested page and optionally the total count depending onPaginatedCriteriaBuilder.withCountQuery(boolean)
.long
getTotalCount()
Executes a query to calculate the total count of elements and returns that count.
-
-
-
Method Detail
-
getTotalCount
long getTotalCount()
Executes a query to calculate the total count of elements and returns that count.- Returns:
- the total count of elements
-
getPageResultList
List<T> getPageResultList()
Returns the result list of the page without executing a count query.- Returns:
- The result list of the requested page
-
getResultList
PagedList<T> getResultList()
Returns aPagedList
containing the result list of the requested page and optionally the total count depending onPaginatedCriteriaBuilder.withCountQuery(boolean)
.- Specified by:
getResultList
in interfacejavax.persistence.Query
- Specified by:
getResultList
in interfacejavax.persistence.TypedQuery<T>
- Returns:
- The result as paged list
-
-