Package com.io7m.cardant.database.postgres.internal

# Class CAAbstractSearch<T>

java.lang.Object
com.io7m.cardant.database.postgres.internal.CAAbstractSearch<T>

Type Parameters:
  `T` - The type of returned values

All Implemented Interfaces:
  `CADatabasePagedQueryType<T>`

public abstract class CAAbstractSearch<T> extends Object implements CADatabasePagedQueryType<T>
A convenient abstract class for performing paginated searches.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract CAPage<T>`
  `page(com.io7m.cardant.database.postgres.internal.CADatabaseTransaction transaction, com.io7m.jqpage.core.JQKeysetRandomAccessPageDefinition page)`
  `protected final int`
  `pageCount()`
  `final CAPage<T>`
  `pageCurrent(CADatabaseTransactionType transaction)`
  Get data for the current page.
  `final CAPage<T>`
  `pageNext(CADatabaseTransactionType transaction)`
  Get data for the next page.
  `final CAPage<T>`
  `pagePrevious(CADatabaseTransactionType transaction)`
  Get data for the previous page.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### pageCount

    protected final int pageCount()

  - ### page

    protected abstract CAPage<T> page(com.io7m.cardant.database.postgres.internal.CADatabaseTransaction transaction, com.io7m.jqpage.core.JQKeysetRandomAccessPageDefinition page) throws CADatabaseException
    Throws:
      `CADatabaseException`

  - ### pageCurrent

    public final CAPage<T> pageCurrent(CADatabaseTransactionType transaction) throws CADatabaseException
    Description copied from interface: `CADatabasePagedQueryType`
    Get data for the current page.
    Specified by:
      `pageCurrent` in interface `CADatabasePagedQueryType<T>`
    Parameters:
      `transaction` - The transaction
    Returns:
      A page of results
    Throws:
      `CADatabaseException` - On errors

  - ### pageNext

    public final CAPage<T> pageNext(CADatabaseTransactionType transaction) throws CADatabaseException
    Description copied from interface: `CADatabasePagedQueryType`
    Get data for the next page. If the current page is the last page, the function acts as `CADatabasePagedQueryType.pageCurrent(CADatabaseTransactionType)`.
    Specified by:
      `pageNext` in interface `CADatabasePagedQueryType<T>`
    Parameters:
      `transaction` - The transaction
    Returns:
      A page of results
    Throws:
      `CADatabaseException` - On errors

  - ### pagePrevious

    public final CAPage<T> pagePrevious(CADatabaseTransactionType transaction) throws CADatabaseException
    Description copied from interface: `CADatabasePagedQueryType`
    Get data for the previous page. If the current page is the first page, the function acts as `CADatabasePagedQueryType.pageCurrent(CADatabaseTransactionType)`.
    Specified by:
      `pagePrevious` in interface `CADatabasePagedQueryType<T>`
    Parameters:
      `transaction` - The transaction
    Returns:
      A page of results
    Throws:
      `CADatabaseException` - On errors