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 int
pageCurrent
(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:IdDatabasePagedQueryType
Get data for the current page.- Specified by:
pageCurrent
in 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:IdDatabasePagedQueryType
Get data for the next page. If the current page is the last page, the function acts asIdDatabasePagedQueryType.pageCurrent(IdDatabaseQueriesType)
.- Specified by:
pageNext
in 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:IdDatabasePagedQueryType
Get data for the previous page. If the current page is the first page, the function acts asIdDatabasePagedQueryType.pageCurrent(IdDatabaseQueriesType)
.- Specified by:
pagePrevious
in interfaceIdDatabasePagedQueryType<R extends Q,
Q extends IdDatabaseQueriesType> - Parameters:
queries
- The query interface- Returns:
- A page of results
- Throws:
IdDatabaseException
- On errors
-