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>
A convenient abstract class for performing paginated searches.
-
Method Summary
Modifier and TypeMethodDescriptionpage(com.io7m.cardant.database.postgres.internal.CADatabaseTransaction transaction, com.io7m.jqpage.core.JQKeysetRandomAccessPageDefinition page) protected final intpageCurrent(CADatabaseTransactionType transaction) Get data for the current page.pageNext(CADatabaseTransactionType transaction) Get data for the next page.pagePrevious(CADatabaseTransactionType transaction) Get data for the previous page.
-
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:CADatabasePagedQueryTypeGet data for the current page.- Specified by:
pageCurrentin interfaceCADatabasePagedQueryType<T>- Parameters:
transaction- The transaction- Returns:
- A page of results
- Throws:
CADatabaseException- On errors
-
pageNext
Description copied from interface:CADatabasePagedQueryTypeGet data for the next page. If the current page is the last page, the function acts asCADatabasePagedQueryType.pageCurrent(CADatabaseTransactionType).- Specified by:
pageNextin interfaceCADatabasePagedQueryType<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:CADatabasePagedQueryTypeGet data for the previous page. If the current page is the first page, the function acts asCADatabasePagedQueryType.pageCurrent(CADatabaseTransactionType).- Specified by:
pagePreviousin interfaceCADatabasePagedQueryType<T>- Parameters:
transaction- The transaction- Returns:
- A page of results
- Throws:
CADatabaseException- On errors
-