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
Modifier and TypeMethodDescriptionReturns the result list of the page without executing a count query.Returns aPagedListcontaining the result list of the requested page and optionally the total count depending onPaginatedCriteriaBuilder.withCountQuery(boolean).longExecutes a query to calculate the total count of elements and returns that count.Methods inherited from interface javax.persistence.Query
executeUpdate, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrapMethods inherited from interface javax.persistence.TypedQuery
getSingleResult, setFirstResult, setFlushMode, setHint, setLockMode, setMaxResults, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter
-
Method Details
-
getTotalCount
long getTotalCount()Executes a query to calculate the total count of elements and returns that count.- Returns:
- the total count of elements
-
getPageResultList
Returns the result list of the page without executing a count query.- Returns:
- The result list of the requested page
-
getResultList
Returns aPagedListcontaining the result list of the requested page and optionally the total count depending onPaginatedCriteriaBuilder.withCountQuery(boolean).- Specified by:
getResultListin interfacejavax.persistence.Query- Specified by:
getResultListin interfacejavax.persistence.TypedQuery<T>- Returns:
- The result as paged list
-