Package org.apache.ignite.cache.query

## Class SqlQuery<K,​V>

- java.lang.Object
- - org.apache.ignite.cache.query.Query<javax.cache.Cache.Entry<K,​V>>
  - - org.apache.ignite.cache.query.SqlQuery<K,​V>

- All Implemented Interfaces:
    `Serializable`

      @Deprecated
      public final class SqlQuery<K,​V>
      extends Query<javax.cache.Cache.Entry<K,​V>>

  Deprecated.
  Since 2.8, please use `SqlFieldsQuery` instead.
  SQL Query.
  See Also:
    `IgniteCache.query(Query)`, Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.cache.query.Query

      `DFLT_PAGE_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SqlQuery​(Class<?> type, String sql)` | Deprecated. Constructs query for the given type and SQL query.
    `SqlQuery​(String type, String sql)` | Deprecated. Constructs query for the given type name and SQL query.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `getAlias()` | Deprecated. Sets table alias for type.
    `Object[]` | `getArgs()` | Deprecated. Gets SQL arguments.
    `@org.jetbrains.annotations.Nullable int[]` | `getPartitions()` | Deprecated.
    `String` | `getSql()` | Deprecated. Gets SQL clause.
    `int` | `getTimeout()` | Deprecated. Gets the query execution timeout in milliseconds.
    `String` | `getType()` | Deprecated. Gets type for query.
    `boolean` | `isDistributedJoins()` | Deprecated. Check if distributed joins are enabled for this query.
    `boolean` | `isReplicatedOnly()` | Deprecated. No longer used as of Apache Ignite 2.8.
    `SqlQuery<K,​V>` | `setAlias​(String alias)` | Deprecated. Gets table alias for type.
    `SqlQuery<K,​V>` | `setArgs​(Object... args)` | Deprecated. Sets SQL arguments.
    `SqlQuery<K,​V>` | `setDistributedJoins​(boolean distributedJoins)` | Deprecated. Specify if distributed joins are enabled for this query.
    `SqlQuery<K,​V>` | `setLocal​(boolean loc)` | Deprecated. Sets whether this query should be executed on local node only.
    `SqlQuery<K,​V>` | `setPageSize​(int pageSize)` | Deprecated. Sets optional page size, if `0`, then default is used.
    `SqlQuery` | `setPartitions​(@org.jetbrains.annotations.Nullable int... parts)` | Deprecated. Sets partitions for a query.
    `SqlQuery<K,​V>` | `setReplicatedOnly​(boolean replicatedOnly)` | Deprecated. No longer used as of Apache Ignite 2.8.
    `SqlQuery<K,​V>` | `setSql​(String sql)` | Deprecated. Sets SQL clause.
    `SqlQuery<K,​V>` | `setTimeout​(int timeout, TimeUnit timeUnit)` | Deprecated. Sets the query execution timeout.
    `SqlQuery<K,​V>` | `setType​(Class<?> type)` | Deprecated.
    `SqlQuery<K,​V>` | `setType​(String type)` | Deprecated. Sets type for query.
    `String` | `toString()` | Deprecated.

    - ### Methods inherited from class org.apache.ignite.cache.query.Query

      `getPageSize, isLocal, prepare`

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

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

- - ### Constructor Detail

    - #### SqlQuery

          public SqlQuery​(String type,
                          String sql)

      Deprecated.
      Constructs query for the given type name and SQL query.
      Parameters:
        `type` - Type.
        `sql` - SQL Query.

    - #### SqlQuery

          public SqlQuery​(Class<?> type,
                          String sql)

      Deprecated.
      Constructs query for the given type and SQL query.
      Parameters:
        `type` - Type.
        `sql` - SQL Query.

  - ### Method Detail

    - #### getSql

          public String getSql()

      Deprecated.
      Gets SQL clause.
      Returns:
        SQL clause.

    - #### setSql

          public SqlQuery<K,​V> setSql​(String sql)

      Deprecated.
      Sets SQL clause.
      Parameters:
        `sql` - SQL clause.
      Returns:
        `this` For chaining.

    - #### getArgs

          public Object[] getArgs()

      Deprecated.
      Gets SQL arguments.
      Returns:
        SQL arguments.

    - #### setArgs

          public SqlQuery<K,​V> setArgs​(Object... args)

      Deprecated.
      Sets SQL arguments.
      Parameters:
        `args` - SQL arguments.
      Returns:
        `this` For chaining.

    - #### getType

          public String getType()

      Deprecated.
      Gets type for query.
      Returns:
        Type.

    - #### setType

          public SqlQuery<K,​V> setType​(String type)

      Deprecated.
      Sets type for query.
      Parameters:
        `type` - Type.
      Returns:
        `this` For chaining.

    - #### getAlias

          public String getAlias()

      Deprecated.
      Sets table alias for type.
      Returns:
        Table alias.

    - #### setAlias

          public SqlQuery<K,​V> setAlias​(String alias)

      Deprecated.
      Gets table alias for type.
      Parameters:
        `alias` - table alias for type that is used in query.
      Returns:
        `this` For chaining.

    - #### getTimeout

          public int getTimeout()

      Deprecated.
      Gets the query execution timeout in milliseconds.
      Returns:
        Timeout value.

    - #### setTimeout

          public SqlQuery<K,​V> setTimeout​(int timeout,
                                                TimeUnit timeUnit)

      Deprecated.
      Sets the query execution timeout. Query will be automatically cancelled if the execution timeout is exceeded.
      Parameters:
        `timeout` - Timeout value. Zero value disables timeout.
        `timeUnit` - Time granularity.
      Returns:
        `this` For chaining.

    - #### setPageSize

          public SqlQuery<K,​V> setPageSize​(int pageSize)

      Deprecated.
      Sets optional page size, if `0`, then default is used.
      Overrides:
        `setPageSize` in class `Query<javax.cache.Cache.Entry<K,​V>>`
      Parameters:
        `pageSize` - Optional page size.
      Returns:
        `this` for chaining.

    - #### setLocal

          public SqlQuery<K,​V> setLocal​(boolean loc)

      Deprecated.
      Sets whether this query should be executed on local node only.
      Overrides:
        `setLocal` in class `Query<javax.cache.Cache.Entry<K,​V>>`
      Parameters:
        `loc` - Local flag.
      Returns:
        `this` for chaining.

    - #### setType

          public SqlQuery<K,​V> setType​(Class<?> type)

      Deprecated.
      Parameters:
        `type` - Type.
      Returns:
        `this` For chaining.

    - #### setDistributedJoins

          public SqlQuery<K,​V> setDistributedJoins​(boolean distributedJoins)

      Deprecated.
      Specify if distributed joins are enabled for this query. When disabled, join results will only contain colocated data (joins work locally). When enabled, joins work as expected, no matter how the data is distributed.
      Parameters:
        `distributedJoins` - Distributed joins enabled.
      Returns:
        `this` For chaining.

    - #### isDistributedJoins

          public boolean isDistributedJoins()

      Deprecated.
      Check if distributed joins are enabled for this query.
      Returns:
        `true` If distributed joins enabled.

    - #### setReplicatedOnly

          @Deprecated
          public SqlQuery<K,​V> setReplicatedOnly​(boolean replicatedOnly)

      Deprecated.
      No longer used as of Apache Ignite 2.8.
      Specify if the query contains only replicated tables. This is a hint for potentially more effective execution.
      Parameters:
        `replicatedOnly` - The query contains only replicated tables.
      Returns:
        `this` For chaining.

    - #### isReplicatedOnly

          @Deprecated
          public boolean isReplicatedOnly()

      Deprecated.
      No longer used as of Apache Ignite 2.8.
      Check is the query contains only replicated tables.
      Returns:
        `true` If the query contains only replicated tables.

    - #### getPartitions

          @Nullable
          public @org.jetbrains.annotations.Nullable int[] getPartitions()

      Deprecated.
      Returns:
        Partitions for query, in ascending order.

    - #### setPartitions

          public SqlQuery setPartitions​(@Nullable
                                        @org.jetbrains.annotations.Nullable int... parts)

      Deprecated.
      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.

      Parameters:
        `parts` - Partitions.
      Returns:
        `this` for chaining.

    - #### toString

          public String toString()

      Deprecated.
      Overrides:
        `toString` in class `Query<javax.cache.Cache.Entry<K,​V>>`