Package org.springframework.data.web
Annotation Interface PageableDefault
Annotation to set defaults when injecting a
Pageable
into a controller
method. Instead of configuring sort()
and direction()
you can also use SortDefault
or
SortDefault.SortDefaults
.- Since:
- 1.6
- Author:
- Oliver Gierke
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe direction to sort by.int
The default-pagenumber the injectedPageable
should get if no corresponding parameter defined in request (default is 0).int
The default-size the injectedPageable
should get if no corresponding parameter defined in request (default is 10).String[]
The properties to sort by by default.int
Alias forsize()
.
-
Element Details
-
value
int valueAlias forsize()
. Prefer to use thesize()
method as it makes the annotation declaration more expressive and you'll probably want to configure thepage()
anyway.- Returns:
- Default:
- 10
-
size
int sizeThe default-size the injectedPageable
should get if no corresponding parameter defined in request (default is 10).- Default:
- 10
-
page
int pageThe default-pagenumber the injectedPageable
should get if no corresponding parameter defined in request (default is 0).- Default:
- 0
-
sort
String[] sortThe properties to sort by by default. If unset, no sorting will be applied at all.- Returns:
- Default:
- {}
-
direction
Sort.Direction directionThe direction to sort by. Defaults toSort.Direction.ASC
.- Returns:
- Default:
- ASC
-