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 Type
    Method
    Description
    Returns the result list of the page without executing a count query.
    Returns a PagedList containing the result list of the requested page and optionally the total count depending on PaginatedCriteriaBuilder.withCountQuery(boolean).
    long
    Executes 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, unwrap

    Methods 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

      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 a PagedList containing the result list of the requested page and optionally the total count depending on PaginatedCriteriaBuilder.withCountQuery(boolean).
      Specified by:
      getResultList in interface jakarta.persistence.Query
      Specified by:
      getResultList in interface jakarta.persistence.TypedQuery<T>
      Returns:
      The result as paged list