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.

  • 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
    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.
  • 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"