Class IdAbstractSearch<R extends Q, Q extends IdDatabaseQueriesType, T>
java.lang.Object
com.io7m.idstore.database.postgres.internal.IdAbstractSearch<R,Q,T>
- Type Parameters:
R- The (internal) type of queriesQ- The type of queriesT- The type of returned values
- All Implemented Interfaces:
IdDatabasePagedQueryType<Q,T>
public abstract class IdAbstractSearch<R extends Q, Q extends IdDatabaseQueriesType, T>
extends Object
implements IdDatabasePagedQueryType<Q,T>
A convenient abstract class for performing paginated searches.
-
Method Summary
Modifier and TypeMethodDescriptionprotected final intpageCurrent(Q queries) Get data for the current page.Get data for the next page.pagePrevious(Q queries) Get data for the previous page.
-
Method Details
-
pageCount
protected final int pageCount() -
page
protected abstract IdPage<T> page(R queries, com.io7m.jqpage.core.JQKeysetRandomAccessPageDefinition page) throws IdDatabaseException - Throws:
IdDatabaseException
-
pageCurrent
Description copied from interface:IdDatabasePagedQueryTypeGet data for the current page.- Specified by:
pageCurrentin interfaceIdDatabasePagedQueryType<R extends Q, Q extends IdDatabaseQueriesType>- Parameters:
queries- The query interface- Returns:
- A page of results
- Throws:
IdDatabaseException- On errors
-
pageNext
Description copied from interface:IdDatabasePagedQueryTypeGet data for the next page. If the current page is the last page, the function acts asIdDatabasePagedQueryType.pageCurrent(IdDatabaseQueriesType).- Specified by:
pageNextin interfaceIdDatabasePagedQueryType<R extends Q, Q extends IdDatabaseQueriesType>- Parameters:
queries- The query interface- Returns:
- A page of results
- Throws:
IdDatabaseException- On errors
-
pagePrevious
Description copied from interface:IdDatabasePagedQueryTypeGet data for the previous page. If the current page is the first page, the function acts asIdDatabasePagedQueryType.pageCurrent(IdDatabaseQueriesType).- Specified by:
pagePreviousin interfaceIdDatabasePagedQueryType<R extends Q, Q extends IdDatabaseQueriesType>- Parameters:
queries- The query interface- Returns:
- A page of results
- Throws:
IdDatabaseException- On errors
-