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
ConstructorsConstructorDescriptionQPageRequest(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 thePageablerequesting the first page.getSort()Returns the sorting parameters.next()static QPageRequestof(int pageNumber, int pageSize) Creates a newQPageRequest.static QPageRequestof(int pageNumber, int pageSize, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Creates a newQPageRequestwith the givenOrderSpecifiers applied.static QPageRequestCreates a newQPageRequestwith sort parameters applied.static QPageRequestofSize(int pageSize) previous()withPage(int pageNumber) Creates a newQPageRequestwithpageNumberapplied.Creates a newQPageRequestwithQSortapplied.Methods inherited from class org.springframework.data.domain.AbstractPageRequest
equals, getOffset, getPageNumber, getPageSize, hashCode, hasPrevious, previousOrFirstMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.domain.Pageable
getSortOr, isPaged, isUnpaged, toOptional, toScrollPosition
-
Constructor Details
-
QPageRequest
Deprecated.since 2.1, useof(int, int)instead.Creates a newQPageRequest. Pages are zero indexed, thus providing 0 forpageNumberwill 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 newQPageRequestwith the givenOrderSpecifiers 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 newQPageRequestwith 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 forpageNumberwill 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 newQPageRequestwith the givenOrderSpecifiers 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 newQPageRequestwith 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:PageableReturns the sorting parameters.- Returns:
-
next
Description copied from interface:Pageable- Specified by:
nextin interfacePageable- Specified by:
nextin classAbstractPageRequest- Returns:
-
previous
Description copied from class:AbstractPageRequest- Specified by:
previousin classAbstractPageRequest- Returns:
-
first
Description copied from interface:PageableReturns thePageablerequesting the first page.- Specified by:
firstin interfacePageable- Specified by:
firstin classAbstractPageRequest- Returns:
-
withPage
Creates a newQPageRequestwithpageNumberapplied.- Parameters:
pageNumber-- Returns:
- a new
PageRequest. - Since:
- 2.5
-
withSort
Creates a newQPageRequestwithQSortapplied.- Parameters:
sort- must not be null.- Returns:
- a new
PageRequest. - Since:
- 2.5
-
of(int, int)instead.