Class QPageRequest
java.lang.Object
org.springframework.data.domain.AbstractPageRequest
org.springframework.data.querydsl.QPageRequest
- All Implemented Interfaces:
Serializable
,Pageable
Basic Java Bean implementation of
Pageable
with support for QueryDSL.- Author:
- Thomas Darimont, Oliver Drotbohm, Mark Paluch, Thach Le
- See Also:
-
Constructor Summary
ConstructorDescriptionQPageRequest
(int pageNumber, int pageSize) Deprecated.QPageRequest
(int pageNumber, int pageSize, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Deprecated.since 2.1, useof(int, int, OrderSpecifier...)
instead.QPageRequest
(int pageNumber, int pageSize, QSort sort) Deprecated.since 2.1, useof(int, int, QSort)
instead. -
Method Summary
Modifier and TypeMethodDescriptionfirst()
Returns thePageable
requesting the first page.getSort()
Returns the sorting parameters.next()
static QPageRequest
of
(int pageNumber, int pageSize) Creates a newQPageRequest
.static QPageRequest
of
(int pageNumber, int pageSize, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Creates a newQPageRequest
with the givenOrderSpecifier
s applied.static QPageRequest
Creates a newQPageRequest
with sort parameters applied.static QPageRequest
ofSize
(int pageSize) previous()
withPage
(int pageNumber) Creates a newQPageRequest
withpageNumber
applied.Creates a newQPageRequest
withQSort
applied.Methods inherited from class org.springframework.data.domain.AbstractPageRequest
equals, getOffset, getPageNumber, getPageSize, hashCode, hasPrevious, previousOrFirst
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.domain.Pageable
getSortOr, isPaged, isUnpaged, toLimit, toOptional, toScrollPosition
-
Constructor Details
-
QPageRequest
Deprecated.since 2.1, useof(int, int)
instead.Creates a newQPageRequest
. Pages are zero indexed, thus providing 0 forpageNumber
will return the first pageNumber.- Parameters:
pageNumber
- zero-based page number, must not be negative.pageSize
- the size of the page to be returned, must be greater than 0.
-
QPageRequest
@Deprecated public QPageRequest(int pageNumber, int pageSize, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Deprecated.since 2.1, useof(int, int, OrderSpecifier...)
instead.Creates a newQPageRequest
with the givenOrderSpecifier
s applied.- Parameters:
pageNumber
- zero-based page number, must not be negative.pageSize
- the size of the page to be returned, must be greater than 0.orderSpecifiers
- must not be null or empty;
-
QPageRequest
Deprecated.since 2.1, useof(int, int, QSort)
instead.Creates a newQPageRequest
with sort parameters applied.- Parameters:
pageNumber
- zero-based page number, must not be negative.pageSize
- the size of the page to be returned, must be greater than 0.sort
- must not be null.
-
-
Method Details
-
of
Creates a newQPageRequest
. Pages are zero indexed, thus providing 0 forpageNumber
will return the first pageNumber.- Parameters:
pageNumber
- zero-based page number, must not be negative.pageSize
- the size of the page to be returned, must be greater than 0.- Since:
- 2.1
-
of
public static QPageRequest of(int pageNumber, int pageSize, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Creates a newQPageRequest
with the givenOrderSpecifier
s applied.- Parameters:
pageNumber
- zero-based page number, must not be negative.pageSize
- the size of the page to be returned, must be greater than 0.orderSpecifiers
- must not be null or empty;- Since:
- 2.1
-
of
Creates a newQPageRequest
with sort parameters applied.- Parameters:
pageNumber
- zero-based page number, must not be negative.pageSize
- the size of the page to be returned, must be greater than 0.sort
- must not be null.- Since:
- 2.1
-
ofSize
- Parameters:
pageSize
- the size of the page to be returned, must be greater than 0.- Returns:
- a new
QPageRequest
. - Since:
- 2.5
-
getSort
Description copied from interface:Pageable
Returns the sorting parameters.- Returns:
-
next
Description copied from interface:Pageable
- Specified by:
next
in interfacePageable
- Specified by:
next
in classAbstractPageRequest
- Returns:
-
previous
Description copied from class:AbstractPageRequest
- Specified by:
previous
in classAbstractPageRequest
- Returns:
-
first
Description copied from interface:Pageable
Returns thePageable
requesting the first page.- Specified by:
first
in interfacePageable
- Specified by:
first
in classAbstractPageRequest
- Returns:
-
withPage
Creates a newQPageRequest
withpageNumber
applied.- Parameters:
pageNumber
-- Returns:
- a new
PageRequest
. - Since:
- 2.5
-
withSort
Creates a newQPageRequest
withQSort
applied.- Parameters:
sort
- must not be null.- Returns:
- a new
PageRequest
. - Since:
- 2.5
-
of(int, int)
instead.