Annotation Interface PageableDefault


@Documented @Retention(RUNTIME) @Target(PARAMETER) public @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 Elements
    Modifier and Type
    Optional Element
    Description
    The direction to sort by.
    int
    The default page number the injected Pageable should use if no corresponding parameter defined in request (default is 0).
    int
    The default-size the injected Pageable should get if no corresponding parameter defined in request (default is 10).
    The properties to sort by default.
    int
    Alias for size().
  • Element Details

    • value

      @AliasFor("size") int value
      Alias for size(). Prefer to use the size() method as it makes the annotation declaration more expressive and you'll probably want to configure the page() anyway.
      Returns:
      Default:
      10
    • size

      @AliasFor("value") int size
      The default-size the injected Pageable should get if no corresponding parameter defined in request (default is 10).
      Default:
      10
    • page

      int page
      The default page number the injected Pageable should use if no corresponding parameter defined in request (default is 0).
      Default:
      0
    • sort

      String[] sort
      The properties to sort by default. If unset, no sorting will be applied at all.
      Returns:
      Default:
      {}
    • direction

      Sort.Direction direction
      The direction to sort by. Defaults to Sort.Direction.ASC.
      Returns:
      Default:
      ASC