Package com.io7m.idstore.database.api
Interface IdDatabasePagingType<P,T,Q extends IdDatabaseQueriesType>
- Type Parameters:
P- The type of immutable parameters used for the queryT- The type of returned valuesQ- The database query interface used
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 TypeMethodDescriptionintpageCurrent(Q queries) Obtain the current page's values.longSeek to the next page and return values within that page.booleanintpagePrevious(Q queries) Seek to the previous page and return values within that page.default boolean
-
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:
trueIf the next page is currently available
-
pagePreviousAvailable
default boolean pagePreviousAvailable()- Returns:
trueIf the previous page is currently available
-
pagePrevious
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
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
Obtain the current page's values.- Parameters:
queries- The queries- Returns:
- The page's results
- Throws:
IdDatabaseException- On database errors
-