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
Optional ElementsModifier and TypeOptional ElementDescriptionThe direction to sort by.intThe default page number the injectedPageableshould use if no corresponding parameter defined in request (default is0).intThe default-size the injectedPageableshould get if no corresponding parameter defined in request (default is10).String[]The properties to sort by default.intAlias forsize().
-
Element Details
-
value
Alias 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
The default-size the injectedPageableshould get if no corresponding parameter defined in request (default is10).- Default:
- 10
-
page
int pageThe default page number the injectedPageableshould 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
-