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
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionQPageRequest(int page, int size) Deprecated.QPageRequest(int page, int size, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Deprecated.since 2.1, useof(int, int, OrderSpecifier...)instead.QPageRequest(int page, int size, 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 page, int size) Creates a newQPageRequest.static QPageRequestof(int page, int size, 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, toLimit, toOptional, toScrollPosition
-
Constructor Details
-
QPageRequest
Deprecated.since 2.1, useof(int, int)instead.Creates a newQPageRequest. Pages are zero indexed, thus providing 0 forpagewill return the first page.- Parameters:
page- must not be negative.size- must be greater or equal to 0.
-
QPageRequest
@Deprecated public QPageRequest(int page, int size, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Deprecated.since 2.1, useof(int, int, OrderSpecifier...)instead.Creates a newQPageRequestwith the givenOrderSpecifiers applied.- Parameters:
page- must not be negative.size- must be greater or equal to 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:
page- must not be negative.size- must be greater or equal to 0.sort- must not be null.
-
-
Method Details
-
of
Creates a newQPageRequest. Pages are zero indexed, thus providing 0 forpagewill return the first page.- Parameters:
page- must not be negative.size- must be greater or equal to 0.- Since:
- 2.1
-
of
public static QPageRequest of(int page, int size, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Creates a newQPageRequestwith the givenOrderSpecifiers applied.- Parameters:
page- must not be negative.size- must be greater or equal to 0.orderSpecifiers- must not be null or empty;- Since:
- 2.1
-
of
Creates a newQPageRequestwith sort parameters applied.- Parameters:
page- must not be negative.size- must be greater or equal to 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.