org.apache.ignite.springdata22.repository.config

## Annotation Type Query

-     @Documented
       @Retention(value=RUNTIME)
       @Target(value=METHOD)
      public @interface Query

  Annotation to provide a user defined query for a method.

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `boolean` | `collocated` Sets flag defining if this query is collocated.
    `boolean` | `distributedJoins` Specify if distributed joins are enabled for this query.
    `boolean` | `dynamicQuery` Specify whether the annotated method must provide a non null `DynamicQueryConfig` parameter with a non empty value (query string) or `DynamicQueryConfig.textQuery()` == true.
    `boolean` | `enforceJoinOrder` Sets flag to enforce join order of tables in the query.
    `boolean` | `forceFieldsQuery` Force SqlFieldsQuery type, deactivating auto-detection based on SELECT statement.
    `boolean` | `lazy` Sets lazy query execution flag.
    `int` | `limit` Sets limit to response records count for TextQuery.
    `boolean` | `local` Sets whether this query should be executed on local node only.
    `int[]` | `parts` Sets partitions for a query.
    `boolean` | `textQuery` Whether annotated repository method must use TextQuery search.
    `int` | `timeout` Query timeout in millis.
    `String` | `value` Query text string.

- - ### Element Detail

    - #### value

          public abstract String value

      Query text string. If not provided, Ignite query generator for Spring Data framework will be used to generate one (only if textQuery = false (default))
      Default:
        ""

  - - #### textQuery

          public abstract boolean textQuery

      Whether annotated repository method must use TextQuery search.
      Default:
        false

  - - #### forceFieldsQuery

          public abstract boolean forceFieldsQuery

      Force SqlFieldsQuery type, deactivating auto-detection based on SELECT statement. Useful for non SELECT statements or to not return hidden fields on SELECT * statements.
      Default:
        false

  - - #### collocated

          public abstract boolean collocated

      Sets flag defining if this query is collocated.

      Collocation flag is used for optimization purposes of queries with GROUP BY statements. Whenever Ignite executes a distributed query, it sends sub-queries to individual cluster members. If you know in advance that the elements of your query selection are collocated together on the same node and you group by collocated key (primary or affinity key), then Ignite can make significant performance and network optimizations by grouping data on remote nodes.

      Only applicable to SqlFieldsQuery

      Default:
        false

  - - #### timeout

          public abstract int timeout

      Query timeout in millis. Sets the query execution timeout. Query will be automatically cancelled if the execution timeout is exceeded. Zero value disables timeout

      Only applicable to SqlFieldsQuery and SqlQuery

      Default:
        0

  - - #### enforceJoinOrder

          public abstract boolean enforceJoinOrder

      Sets flag to enforce join order of tables in the query. If set to `true` query optimizer will not reorder tables in join. By default is `false`.

      It is not recommended to enable this property until you are sure that your indexes and the query itself are correct and tuned as much as possible but query optimizer still produces wrong join order.

      Only applicable to SqlFieldsQuery

      Default:
        false

  - - #### distributedJoins

          public abstract boolean distributedJoins

      Specify if distributed joins are enabled for this query.

      Only applicable to SqlFieldsQuery and SqlQuery

      Default:
        false

  - - #### lazy

          public abstract boolean lazy

      Sets lazy query execution flag.

      By default Ignite attempts to fetch the whole query result set to memory and send it to the client. For small and medium result sets this provides optimal performance and minimize duration of internal database locks, thus increasing concurrency.

      If result set is too big to fit in available memory this could lead to excessive GC pauses and even OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory consumption at the cost of moderate performance hit.

      Defaults to `false`, meaning that the whole result set is fetched to memory eagerly.

      Only applicable to SqlFieldsQuery

      Default:
        false

  - - #### local

          public abstract boolean local

      Sets whether this query should be executed on local node only.
      Default:
        false

  - - #### parts

          public abstract int[] parts

      Sets partitions for a query. The query will be executed only on nodes which are primary for specified partitions.

      Note what passed array'll be sorted in place for performance reasons, if it wasn't sorted yet.

      Only applicable to SqlFieldsQuery and SqlQuery

      Default:
        {}

  - - #### dynamicQuery

          public abstract boolean dynamicQuery

      Specify whether the annotated method must provide a non null `DynamicQueryConfig` parameter with a non empty value (query string) or `DynamicQueryConfig.textQuery()` == true.

      Please, note that `DynamicQueryConfig.textQuery()` annotation parameters will be ignored in favor of those defined in `DynamicQueryConfig` parameter if present (runtime ignite query tuning).

      Default:
        false

  - - #### limit

          public abstract int limit

      Sets limit to response records count for TextQuery. If 0 or less, considered to be no limit.
      Default:
        0

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020