Spring Data Core

org.springframework.data.web
Annotation Type PageableDefault


@Documented
@Retention(value=RUNTIME)
@Target(value=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

Optional Element Summary
 Sort.Direction direction
          The direction to sort by.
 int page
          The default-pagenumber the injected Pageable should get if no corresponding parameter defined in request (default is 0).
 int size
          The default-size the injected Pageable should get if no corresponding parameter defined in request (default is 10).
 String[] sort
          The properties to sort by by default.
 int value
          Alias for size().
 

value

public abstract 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

public abstract int size
The default-size the injected Pageable should get if no corresponding parameter defined in request (default is 10).

Default:
10

page

public abstract int page
The default-pagenumber the injected Pageable should get if no corresponding parameter defined in request (default is 0).

Default:
0

sort

public abstract String[] sort
The properties to sort by by default. If unset, no sorting will be applied at all.

Returns:
Default:
{}

direction

public abstract Sort.Direction direction
The direction to sort by. Defaults to Sort.Direction.ASC.

Returns:
Default:
org.springframework.data.domain.Sort.Direction.ASC

Spring Data Core

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.