Package org.apache.calcite.avatica

## Class QueryState

- java.lang.Object
- - org.apache.calcite.avatica.QueryState

    public class QueryState
    extends java.lang.Object

A struct used to encapsulate the necessary information to reconstitute a ResultSet in the Avatica server.

### Nested Class Summary

Nested Classes
`static class` `QueryState.StateType` An enumeration that represents how a ResultSet was created.

### Field Summary

Fields
`MetaDataOperation` `metaDataOperation`
`java.lang.Object[]` `operationArgs`
`java.lang.String` `sql`
`QueryState.StateType` `type`

### Constructor Summary

Constructors
`QueryState()` Not intended for external use.
`QueryState​(java.lang.String sql)` Constructor encapsulating a SQL query used to create a result set.
`QueryState​(QueryState.StateType type, java.lang.String sql, MetaDataOperation op, java.lang.Object... args)` Not intended for external use.
`QueryState​(MetaDataOperation op, java.lang.Object... args)` Constructor encapsulating a metadata operation's result set.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals​(java.lang.Object o)`
`static QueryState` `fromProto​(Common.QueryState protoState)`
`MetaDataOperation` `getMetaDataOperation()`
`java.lang.Object[]` `getOperationArgs()`
`java.lang.String` `getSql()`
`QueryState.StateType` `getType()`
`int` `hashCode()`
`java.sql.ResultSet` `invoke​(java.sql.Connection conn, java.sql.Statement statement)`
`Common.QueryState` `toProto()`
`private void` `verifyOpArgs​(int expectedArgs)`

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

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

### Field Detail

#### type

    public final QueryState.StateType type

#### sql

    public final java.lang.String sql

#### metaDataOperation

    public final MetaDataOperation metaDataOperation

#### operationArgs

    public final java.lang.Object[] operationArgs

### Constructor Detail

#### QueryState

    public QueryState​(java.lang.String sql)

Constructor encapsulating a SQL query used to create a result set.

Parameters:
  `sql` - The SQL query.

#### QueryState

    public QueryState​(MetaDataOperation op,
                      java.lang.Object... args)

Constructor encapsulating a metadata operation's result set.

Parameters:
  `op` - A pointer to the `DatabaseMetaData` operation being invoked.
  `args` - The arguments to the method being invoked.

#### QueryState

    public QueryState​(QueryState.StateType type,
                      java.lang.String sql,
                      MetaDataOperation op,
                      java.lang.Object... args)

Not intended for external use. For Jackson-databind only.

#### QueryState

    public QueryState()

Not intended for external use. For Jackson-databind only.

### Method Detail

#### getType

    public QueryState.StateType getType()

Returns:
  The `QueryState.StateType` for this encapsulated state.

#### getSql

    public java.lang.String getSql()

Returns:
  The SQL expression to invoke.

#### getMetaDataOperation

    public MetaDataOperation getMetaDataOperation()

Returns:
  The metadata operation to invoke.

#### getOperationArgs

    public java.lang.Object[] getOperationArgs()

Returns:
  The Arguments for the given metadata operation.

#### invoke

    public java.sql.ResultSet invoke​(java.sql.Connection conn,
                                     java.sql.Statement statement)
                              throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### verifyOpArgs

    private void verifyOpArgs​(int expectedArgs)

#### toProto

    public Common.QueryState toProto()

#### fromProto

    public static QueryState fromProto​(Common.QueryState protoState)

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### equals

    public boolean equals​(java.lang.Object o)

Overrides:
  `equals` in class `java.lang.Object`