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, Mark Paluch
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe direction to sort by.int
The default page number the injectedPageable
should use if no corresponding parameter defined in request (default is0
).int
The default-size the injectedPageable
should get if no corresponding parameter defined in request (default is10
).String[]
The properties to sort by default.int
Alias forsize()
.
-
Element Details
-
value
@AliasFor("size") 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
@AliasFor("value") int sizeThe default-size the injectedPageable
should get if no corresponding parameter defined in request (default is10
).- Default:
- 10
-
page
int pageThe default page number the injectedPageable
should use if no corresponding parameter defined in request (default is0
).- Default:
- 0
-
sort
String[] sortThe properties to sort 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
-