Annotation Interface RestrictedPageable
Marks a
Pageable controller method parameter
as subject to field-level sorting restrictions.
When applied, the pageable argument is validated so that sorting is only
allowed on entity fields explicitly annotated with Sortable.
This annotation does not affect pagination parameters
such as page number or page size. It only governs which fields may be used
in sort query parameters.
The validation is enforced by a custom
HandlerMethodArgumentResolver
before the controller method is invoked.
Example usage:
@GetMapping
public Page<User> search(
@RestrictedPageable(entityClass = User.class) Pageable pageable
) {
...
}
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass<?> Entity class whose fields define the set of properties that may be used for sorting.