Annotation Interface DynamicQuery


@Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) @Documented public @interface DynamicQuery
Annotation to declare finder dynamic queries directly on repository methods.
Since:
2.x.1
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Defines the projection part of the count query template that is generated for pagination.
    Defines a special count query template that shall be used for pagination queries to lookup the total number of elements for a page.
    boolean
    Configures whether the given query is a native one.
    Class<? extends org.springframework.data.jpa.repository.QueryRewriter>
    Define a QueryRewriter that should be applied to the query string after the query is fully assembled.
    Defines the JPA query template to be executed when the annotated method is called.
  • Element Details

    • value

      String value
      Defines the JPA query template to be executed when the annotated method is called.
      Returns:
      the JPA query template
      Default:
      ""
    • countQuery

      String countQuery
      Defines a special count query template that shall be used for pagination queries to lookup the total number of elements for a page.
      Returns:
      the count query template
      Default:
      ""
    • countProjection

      String countProjection
      Defines the projection part of the count query template that is generated for pagination.
      Returns:
      the count query projection template
      Default:
      ""
    • nativeQuery

      boolean nativeQuery
      Configures whether the given query is a native one. Defaults to false.
      Returns:
      true if the query is native
      Default:
      false
    • queryRewriter

      Class<? extends org.springframework.data.jpa.repository.QueryRewriter> queryRewriter
      Define a QueryRewriter that should be applied to the query string after the query is fully assembled.
      Since:
      3.0
      Default:
      org.springframework.data.jpa.repository.QueryRewriter.IdentityQueryRewriter.class