org.apache.ignite.springdata20.repository.config

## Class DynamicQueryConfig

- java.lang.Object
- - org.apache.ignite.springdata20.repository.config.DynamicQueryConfig

-     public class DynamicQueryConfig
      extends Object

  Runtime Dynamic query configuration.

  Can be used as special repository method parameter to provide at runtime:

  1. Dynamic query string (requires `Query.dynamicQuery()` == true)
  2. Ignite query tuning*

  * Please, note that `Query` annotation parameters will be ignored in favor of those defined in `DynamicQueryConfig` parameter if present.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DynamicQueryConfig()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `collocated()` Sets flag defining if this query is collocated.
    `boolean` | `distributedJoins()` Specify if distributed joins are enabled for this query.
    `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.
    `static DynamicQueryConfig` | `fromQueryAnnotation(Query queryConfiguration)` From Query annotation.
    `boolean` | `lazy()` Sets lazy query execution flag.
    `int` | `limit()` Gets 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.
    `DynamicQueryConfig` | `setCollocated(boolean collocated)` Sets collocated.
    `DynamicQueryConfig` | `setDistributedJoins(boolean distributedJoins)` Sets distributed joins.
    `DynamicQueryConfig` | `setEnforceJoinOrder(boolean enforceJoinOrder)` Sets enforce join order.
    `DynamicQueryConfig` | `setForceFieldsQuery(boolean forceFieldsQuery)` Sets force fields query.
    `DynamicQueryConfig` | `setLazy(boolean lazy)` Sets lazy.
    `DynamicQueryConfig` | `setLimit(int limit)` Sets limit to response records count for TextQuery.
    `DynamicQueryConfig` | `setLocal(boolean local)` Sets local.
    `DynamicQueryConfig` | `setParts(int[] parts)` Sets parts.
    `DynamicQueryConfig` | `setTextQuery(boolean textQuery)` Sets text query.
    `DynamicQueryConfig` | `setTimeout(int timeout)` Sets timeout.
    `DynamicQueryConfig` | `setValue(String value)` Sets value.
    `boolean` | `textQuery()` Whether must use TextQuery search.
    `int` | `timeout()` Query timeout in millis.
    `String` | `value()` Query text string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DynamicQueryConfig

          public DynamicQueryConfig()

  - ### Method Detail

    - #### fromQueryAnnotation

          public static DynamicQueryConfig fromQueryAnnotation(Query queryConfiguration)

      From Query annotation.
      Parameters:
        `queryConfiguration` - the query configuration
      Returns:
        the dynamic query config

    - #### value

          public String value()

      Query text string.
      Returns:
        the string

    - #### textQuery

          public boolean textQuery()

      Whether must use TextQuery search.
      Returns:
        the boolean

    - #### forceFieldsQuery

          public 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.
      Returns:
        the boolean

    - #### collocated

          public 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

      Returns:
        the boolean

    - #### timeout

          public 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

      Returns:
        the int

    - #### enforceJoinOrder

          public 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

      Returns:
        the boolean

    - #### distributedJoins

          public boolean distributedJoins()

      Specify if distributed joins are enabled for this query.

      Only applicable to SqlFieldsQuery and SqlQuery

      Returns:
        the boolean

    - #### lazy

          public 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

      Returns:
        the boolean

    - #### local

          public boolean local()

      Sets whether this query should be executed on local node only.
      Returns:
        the boolean

    - #### parts

          public 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

      Returns:
        the int [ ]

    - #### limit

          public int limit()

      Gets limit to response records count for TextQuery. If 0 or less, considered to be no limit.
      Returns:
        Limit value.

    - #### setValue

          public DynamicQueryConfig setValue(String value)

      Sets value.
      Parameters:
        `value` - the value
      Returns:
        this for chaining

    - #### setTextQuery

          public DynamicQueryConfig setTextQuery(boolean textQuery)

      Sets text query.
      Parameters:
        `textQuery` - the text query
      Returns:
        this for chaining

    - #### setForceFieldsQuery

          public DynamicQueryConfig setForceFieldsQuery(boolean forceFieldsQuery)

      Sets force fields query.
      Parameters:
        `forceFieldsQuery` - the force fields query
      Returns:
        this for chaining

    - #### setCollocated

          public DynamicQueryConfig setCollocated(boolean collocated)

      Sets collocated.
      Parameters:
        `collocated` - the collocated
      Returns:
        this for chaining

    - #### setTimeout

          public DynamicQueryConfig setTimeout(int timeout)

      Sets timeout.
      Parameters:
        `timeout` - the timeout
      Returns:
        this for chaining

    - #### setEnforceJoinOrder

          public DynamicQueryConfig setEnforceJoinOrder(boolean enforceJoinOrder)

      Sets enforce join order.
      Parameters:
        `enforceJoinOrder` - the enforce join order
      Returns:
        this for chaining

    - #### setDistributedJoins

          public DynamicQueryConfig setDistributedJoins(boolean distributedJoins)

      Sets distributed joins.
      Parameters:
        `distributedJoins` - the distributed joins
      Returns:
        this for chaining

    - #### setLazy

          public DynamicQueryConfig setLazy(boolean lazy)

      Sets lazy.
      Parameters:
        `lazy` - the lazy
      Returns:
        this for chaining

    - #### setLocal

          public DynamicQueryConfig setLocal(boolean local)

      Sets local.
      Parameters:
        `local` - the local
      Returns:
        this for chaining

    - #### setParts

          public DynamicQueryConfig setParts(int[] parts)

      Sets parts.
      Parameters:
        `parts` - the parts
      Returns:
        this for chaining

    - #### setLimit

          public DynamicQueryConfig setLimit(int limit)

      Sets limit to response records count for TextQuery.
      Parameters:
        `limit` - If 0 or less, considered to be no limit.
      Returns:
        `this` For chaining.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020