Annotation Interface Sortable


@Target(FIELD) @Retention(RUNTIME) public @interface Sortable
Marks an entity field as eligible for sorting in API query requests.

Fields annotated with @Sortable may be referenced in sort query parameters when pagination is enabled via RestrictedPageable.

This annotation is purely declarative and does not impose any persistence or indexing requirements. Its sole purpose is to explicitly whitelist fields that are safe and supported for sorting at the API level.

Sorting requests targeting fields not annotated with @Sortable will be rejected during request resolution.

Example usage:


 @Entity
 public class User {

     @Sortable
     private String username;

     @Sortable
     private Instant createdAt;
 }