Package com.blazebit.persistence
Interface PaginatedTypedQuery<T>
- Type Parameters:
T- the return type of elements
- All Superinterfaces:
jakarta.persistence.Query,jakarta.persistence.TypedQuery<T>
public interface PaginatedTypedQuery<T>
extends jakarta.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 jakarta.persistence.Query
executeUpdate, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrapMethods inherited from interface jakarta.persistence.TypedQuery
getResultStream, 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 interfacejakarta.persistence.Query- Specified by:
getResultListin interfacejakarta.persistence.TypedQuery<T>- Returns:
- The result as paged list
-