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

    Methods 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

      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 javax.persistence.Query
      Specified by:
      getResultList in interface javax.persistence.TypedQuery<T>
      Returns:
      The result as paged list