public interface Paging
Used to specify Paging on a Query as an alternative to setting each of the
maxRows, firstRow and orderBy clause via:
QueryBuilder.setMaxRows(int) + QueryBuilder.setFirstRow(int) + QueryBuilder.setOrderBy(OrderBy).
Example use:
var orderBy = OrderBy.of("lastName desc nulls first, firstName asc");
var paging = Paging.of(0, 100, orderBy);
new QCustomer()
.name.isNotNull()
.setPaging(paging)
.findList();
-
Method Summary
Modifier and TypeMethodDescriptionstatic Pagingof(int pageIndex, int pageSize) Create a Paging that will use the id property for ordering.static PagingCreate a Paging with the given page index size and orderBy.static PagingCreate a Paging with a raw order by clause.static PagingofNone()Return a Paging that will not apply any pagination to a query.OrderBy<?> orderBy()Return the order by.intReturn the page index.intpageSize()Return the page size.withOrderBy(String orderByClause) Return a Paging using the given order by clause.withPage(int pageIndex) Return a Paging using the given page index.
-
Method Details
-
of
Create a Paging with the given page index size and orderBy.- Parameters:
pageIndex- the page index starting from zeropageSize- the page size (effectively max rows)orderBy- order by for the query result
-
of
Create a Paging with a raw order by clause.- Parameters:
pageIndex- the page index starting from zeropageSize- the page size (effectively max rows)orderByClause- raw order by clause for ordering the query result
-
of
Create a Paging that will use the id property for ordering.- Parameters:
pageIndex- the page index starting from zeropageSize- the page size (effectively max rows)
-
ofNone
Return a Paging that will not apply any pagination to a query. -
pageIndex
int pageIndex()Return the page index. -
pageSize
int pageSize()Return the page size. -
orderBy
OrderBy<?> orderBy()Return the order by. -
withPage
Return a Paging using the given page index. -
withOrderBy
Return a Paging using the given order by clause.
-