org.apache.ignite.internal.processors.cache.query

## Class GridCacheSqlQuery

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.query.GridCacheSqlQuery

All Implemented Interfaces:
  Serializable, Message

    public class GridCacheSqlQuery
    extends Object
    implements Message

Query.

See Also:
  Serialized Form

### Field Summary

Fields
`static Object[]` `EMPTY_PARAMS`

### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`DIRECT_TYPE_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheSqlQuery()` For `Message`.
`GridCacheSqlQuery(String qry)`

### Method Summary

All Methods Instance Methods Concrete Methods
`LinkedHashMap<String,?>` `columns()`
`GridCacheSqlQuery` `columns(LinkedHashMap<String,?> columns)`
`GridCacheSqlQuery` `copy()`
`Object` `derivedPartitions()`
`void` `derivedPartitions(Object derivedPartitions)`
`short` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`boolean` `hasOuterJoinReplicatedPartitioned()`
`GridCacheSqlQuery` `hasOuterJoinReplicatedPartitioned(boolean hasOuterJoinReplicatedPartitioned)`
`boolean` `hasSubQueries()`
`GridCacheSqlQuery` `hasSubQueries(boolean hasSubQries)`
`boolean` `isPartitioned()`
`UUID` `node()`
`GridCacheSqlQuery` `node(UUID node)`
`void` `onAckReceived()` Method called when ack message received.
`int[]` `parameterIndexes()`
`GridCacheSqlQuery` `parameterIndexes(int[] paramIdxs)`
`Object[]` `parameters(Object[] allParams)`
`void` `partitioned(boolean partitioned)`
`String` `query()`
`GridCacheSqlQuery` `query(String qry)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`List<?>` `sortColumns()`
`void` `sortColumns(List<?> sort)`
`String` `toString()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

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

### Field Detail

#### EMPTY_PARAMS

    public static final Object[] EMPTY_PARAMS

### Constructor Detail

#### GridCacheSqlQuery

    public GridCacheSqlQuery()

For `Message`.

#### GridCacheSqlQuery

    public GridCacheSqlQuery(String qry)

Parameters:
  `qry` - Query.

### Method Detail

#### columns

    public LinkedHashMap<String,?> columns()

Returns:
  Columns.

#### columns

    public GridCacheSqlQuery columns(LinkedHashMap<String,?> columns)

Parameters:
  `columns` - Columns.
Returns:
  `this`.

#### query

    public String query()

Returns:
  Query.

#### query

    public GridCacheSqlQuery query(String qry)

Parameters:
  `qry` - Query.
Returns:
  `this`.

#### parameterIndexes

    public int[] parameterIndexes()

Returns:
  Parameter indexes.

#### parameterIndexes

    public GridCacheSqlQuery parameterIndexes(int[] paramIdxs)

Parameters:
  `paramIdxs` - Parameter indexes.
Returns:
  `this`.

#### onAckReceived

    public void onAckReceived()

Method called when ack message received.

Specified by:
  `onAckReceived` in interface `Message`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                           MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                            MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public short directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Returns:
  Fields count.

#### copy

    public GridCacheSqlQuery copy()

Returns:
  Copy.

#### sortColumns

    public void sortColumns(List<?> sort)

Parameters:
  `sort` - Sort columns.

#### sortColumns

    public List<?> sortColumns()

Returns:
  Sort columns.

#### partitioned

    public void partitioned(boolean partitioned)

Parameters:
  `partitioned` - If the query contains partitioned tables.

#### isPartitioned

    public boolean isPartitioned()

Returns:
  `true` If the query contains partitioned tables.

#### node

    public UUID node()

Returns:
  Single node to execute the query on or `null` if need to execute on all the nodes.

#### node

    public GridCacheSqlQuery node(UUID node)

Parameters:
  `node` - Single node to execute the query on or `null` if need to execute on all the nodes.
Returns:
  `this`.

#### parameters

    public Object[] parameters(Object[] allParams)

Parameters:
  `allParams` - All parameters.
Returns:
  Parameters only for this query.

#### derivedPartitions

    public Object derivedPartitions()

Returns:
  Derived partitions.

#### derivedPartitions

    public void derivedPartitions(Object derivedPartitions)

Parameters:
  `derivedPartitions` - Derived partitions.

#### hasSubQueries

    public boolean hasSubQueries()

Returns:
  `true` if query contains sub-queries.

#### hasSubQueries

    public GridCacheSqlQuery hasSubQueries(boolean hasSubQries)

Parameters:
  `hasSubQries` - Flag indicating that the query contains sub-queries.
Returns:
  `this`.

#### hasOuterJoinReplicatedPartitioned

    public boolean hasOuterJoinReplicatedPartitioned()

Returns:
  `true` if the query contains an OUTER JOIN from REPLICATED to PARTITIONED.

#### hasOuterJoinReplicatedPartitioned

    public GridCacheSqlQuery hasOuterJoinReplicatedPartitioned(boolean hasOuterJoinReplicatedPartitioned)

Parameters:
  `hasOuterJoinReplicatedPartitioned` - Flag indicating that the query contains an OUTER JOIN from REPLICATED to PARTITIONED.
Returns:
  `this`.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022