Package com.io7m.idstore.database.api

# Interface IdDatabasePagingType<P,T,Q extends IdDatabaseQueriesType>

Type Parameters:
  `P` - The type of immutable parameters used for the query
  `T` - The type of returned values
  `Q` - The database query interface used

All Known Subinterfaces:
  `IdDatabaseAdminSearchByEmailPagingType`, `IdDatabaseAdminSearchPagingType`, `IdDatabaseAuditListPagingType`, `IdDatabaseUserSearchByEmailPagingType`, `IdDatabaseUserSearchPagingType`

All Known Implementing Classes:
  `IdDatabaseAdminSearchByEmailPaging`, `IdDatabaseAdminSearchPaging`, `IdDatabaseAuditListPaging`, `IdDatabaseUserSearchByEmailPaging`, `IdDatabaseUserSearchPaging`

public interface IdDatabasePagingType<P,T,Q extends IdDatabaseQueriesType>
The base type of paging handlers for returning large result sets. A handler accepts parameters of type `P` that can conceptually be thought of as the raw query parameters that would return all of the results if no limiting was specified. The paging handler implementation maintains "pointers" to pages of results and allows for fast seeking between pages.

See Also:
  - "https://blog.jooq.org/faster-sql-paging-with-jooq-using-the-seek-method/"

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `pageCount()`
  `List<T>`
  `pageCurrent(Q queries)`
  Obtain the current page's values.
  `long`
  `pageFirstOffset()`
  `List<T>`
  `pageNext(Q queries)`
  Seek to the next page and return values within that page.
  `boolean`
  `pageNextAvailable()`
  `int`
  `pageNumber()`
  `P`
  `pageParameters()`
  `List<T>`
  `pagePrevious(Q queries)`
  Seek to the previous page and return values within that page.
  `default boolean`
  `pagePreviousAvailable()`

- ## Method Details

  - ### pageParameters

    P pageParameters()
    Returns:
      The immutable page parameters used for the queries

  - ### pageNumber

    int pageNumber()
    Returns:
      The current page number

  - ### pageFirstOffset

    long pageFirstOffset()
    Returns:
      The index of the first item in the current page

  - ### pageCount

    int pageCount()
    Returns:
      An approximate count of the number of available pages

  - ### pageNextAvailable

    boolean pageNextAvailable()
    Returns:
      `true` If the next page is currently available

  - ### pagePreviousAvailable

    default boolean pagePreviousAvailable()
    Returns:
      `true` If the previous page is currently available

  - ### pagePrevious

    List<T> pagePrevious(Q queries) throws IdDatabaseException
    Seek to the previous page and return values within that page.
    Parameters:
      `queries` - The queries
    Returns:
      The page's results
    Throws:
      `IdDatabaseException` - On database errors

  - ### pageNext

    List<T> pageNext(Q queries) throws IdDatabaseException
    Seek to the next page and return values within that page.
    Parameters:
      `queries` - The queries
    Returns:
      The page's results
    Throws:
      `IdDatabaseException` - On database errors

  - ### pageCurrent

    List<T> pageCurrent(Q queries) throws IdDatabaseException
    Obtain the current page's values.
    Parameters:
      `queries` - The queries
    Returns:
      The page's results
    Throws:
      `IdDatabaseException` - On database errors