Annotation Interface WebQuery


@Target(METHOD) @Retention(RUNTIME) @Documented public @interface WebQuery
Declares shared web-query metadata for a controller method.

This annotation is intended to be placed on handler methods so query-related configuration can be defined once and reused by both filtering and sorting argument resolvers.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Policy for resolving whether a logical operator is permitted.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Entity class against which filter and sort fields are resolved.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Whether logical AND operator (;) is allowed in RSQL filters.
    Whether logical OR operator (,) is allowed in RSQL filters.
    Optional DTO class used as the API-facing query contract.
    Optional field mappings used to expose API-facing aliases for entity fields.
    Request parameter name from which RSQL filter expressions are read.
    int
    Maximum allowed depth of the RSQL Abstract Syntax Tree.
  • Element Details

    • entityClass

      Class<?> entityClass
      Entity class against which filter and sort fields are resolved.
      Returns:
      target entity class
    • dtoClass

      Class<?> dtoClass
      Optional DTO class used as the API-facing query contract.

      When set, incoming filter/sort paths are validated against this DTO and translated to entity paths (optionally using MapsTo). When left as void.class, entity fields are used directly.

      Returns:
      DTO class or void.class when DTO mapping is disabled
      Default:
      void.class
    • fieldMappings

      FieldMapping[] fieldMappings
      Optional field mappings used to expose API-facing aliases for entity fields.

      These mappings are applied in entity-aware mode (dtoClass = void.class). In DTO-aware mode, path translation is driven by MapsTo annotations on DTO fields.

      Returns:
      mappings between API names and entity paths
      Default:
      {}
    • filterParamName

      String filterParamName
      Request parameter name from which RSQL filter expressions are read.

      This setting applies to specification resolution in both entity-aware and DTO-aware modes.

      Returns:
      HTTP query parameter name containing the RSQL filter expression
      Default:
      "filter"
    • allowAndOperator

      WebQuery.OperatorPolicy allowAndOperator
      Whether logical AND operator (;) is allowed in RSQL filters.

      The default is WebQuery.OperatorPolicy.GLOBAL, which delegates the decision to the resolver's configured global default.

      Returns:
      operator policy for logical AND nodes
      Default:
      GLOBAL
    • allowOrOperator

      WebQuery.OperatorPolicy allowOrOperator
      Whether logical OR operator (,) is allowed in RSQL filters.

      The default is WebQuery.OperatorPolicy.GLOBAL, which delegates the decision to the resolver's configured global default.

      Returns:
      operator policy for logical OR nodes
      Default:
      GLOBAL
    • maxASTDepth

      int maxASTDepth
      Maximum allowed depth of the RSQL Abstract Syntax Tree.

      Depth starts at 0 for the root node. A negative value delegates to the resolver's configured global maximum.

      Returns:
      maximum allowed AST depth
      Default:
      -1