Click or drag to resize

SimpleStatement Class

A simple IStatement implementation built directly from a query string.
Inheritance Hierarchy
SystemObject
  DseStatement
    DseRegularStatement
      DseSimpleStatement
        Dse.Data.LinqCqlCommand

Namespace:  Dse
Assembly:  Dse (in Dse.dll) Version: 2.6.0
Syntax
C#
public class SimpleStatement : RegularStatement

The SimpleStatement type exposes the following members.

Constructors
  NameDescription
Public methodSimpleStatement
Creates a new instance of SimpleStatement without any query string or parameters.
Public methodSimpleStatement(String)
Creates a new instance of SimpleStatement with the provided CQL query.
Public methodCode exampleSimpleStatement(IDictionaryString, Object, String)
Creates a new instance of SimpleStatement using a dictionary of parameters and a query with named parameters.
Public methodCode exampleSimpleStatement(String, Object)
Creates a new instance of SimpleStatement with the provided CQL query and values provided.
Top
Properties
  NameDescription
Public propertyAutoPage
Determines if the RowSet returned when executing this IStatement will automatically fetch the following result pages. Defaults to true.
(Inherited from Statement.)
Public propertyConsistencyLevel
Gets the consistency level for this query.
(Inherited from Statement.)
Public propertyHost
Gets the host configured on this Statement, or null if none is configured.

In the general case, the host used to execute this Statement will depend on the configured ILoadBalancingPolicy and this property will return null.

(Inherited from Statement.)
Public propertyIsIdempotent
Determines if this statement is idempotent, i.e. whether it can be applied multiple times without changing the result beyond the initial application.

Idempotence of the statement plays a role in ISpeculativeExecutionPolicy. If a statement is not idempotent, the driver will not schedule speculative executions for it.

When the property is null, the driver will use the default value from the GetDefaultIdempotence.
(Inherited from Statement.)
Public propertyIsTracing
Gets whether tracing is enabled for this query or not.
(Inherited from Statement.)
Public propertyKeyspace
Returns the keyspace this query operates on, as set using SetKeyspace(String)

The keyspace returned is used as a hint for token-aware routing.

(Overrides StatementKeyspace.)
Public propertyOutgoingPayload
Gets custom payload for that will be included when executing this Statement.
(Inherited from Statement.)
Public propertyPageSize
Gets query's page size.
(Inherited from Statement.)
Public propertyPagingState
This object represents the next page to be fetched if the query is multi page. It can be saved and reused later on a different execution.
(Inherited from Statement.)
Public propertyQueryString
Gets the query string.
(Overrides RegularStatementQueryString.)
Public propertyQueryValues (Inherited from Statement.)
Public propertyReadTimeoutMillis
Gets the per-host read timeout for this statement.

When the value is 0 or lower, the default value from the socket options will be used.

(Inherited from Statement.)
Public propertyRetryPolicy
Gets the retry policy sets for this query, if any.
(Inherited from Statement.)
Public propertyRoutingKey (Overrides StatementRoutingKey.)
Public propertySerialConsistencyLevel
Gets the serial consistency level for this query.
(Inherited from Statement.)
Public propertySkipMetadata (Inherited from Statement.)
Public propertyTimestamp
Gets the timestamp associated with this statement execution.
(Inherited from Statement.)
Top
Methods
  NameDescription
Public methodBind Obsolete.
Sets the parameter values for the query.

The same amount of values must be provided as parameter markers in the query.

Specify the parameter values by the position of the markers in the query or by name, using a single instance of an anonymous type, with property names as parameter names.

Public methodBindObjects Obsolete.
Public methodDisableTracing
Disable tracing for the statement.
(Inherited from Statement.)
Public methodEnableTracing
Enables tracing for the statement
(Inherited from Statement.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecutingAs
Allows this statement to be executed as a different user/role than the one currently authenticated (a.k.a. proxy execution).
(Inherited from Statement.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodSetAutoPage
Sets the paging behavior. When set to true (default), the RowSet returned when executing this IStatement will automatically fetch the following result pages. When false, the RowSet returned will only contain the rows contained in the result page and will not fetch additional pages.
(Inherited from Statement.)
Public methodSetConsistencyLevel
Sets the consistency level for the query.

The default consistency level, if this method is not called, is ConsistencyLevel.ONE.

(Inherited from Statement.)
Public methodSetHost
Sets the Host that should handle this query.

In the general case, use of this method is heavily discouraged and should only be used in the following cases:

  • Querying node-local tables, such as tables in the system and system_views keyspaces.
  • Applying a series of schema changes, where it may be advantageous to execute schema changes in sequence on the same node.

Configuring a specific host causes the configured ILoadBalancingPolicy to be completely bypassed. However, if the load balancing policy dictates that the host is at distance Ignored or there is no active connectivity to the host, the request will fail with a NoHostAvailableException.

(Inherited from Statement.)
Public methodSetIdempotence
Sets whether this statement is idempotent.

Idempotence of the statement plays a role in ISpeculativeExecutionPolicy. If a statement is not idempotent, the driver will not schedule speculative executions for it.

(Inherited from Statement.)
Public methodSetKeyspace
Sets the keyspace this Statement operates on. The keyspace should only be set when the IStatement applies to a different keyspace to the logged keyspace of the ISession.
Public methodSetOutgoingPayload
Sets a custom outgoing payload for this statement. Each time this statement is executed, this payload will be included in the request. Once it is set using this method, the payload should not be modified.
(Inherited from Statement.)
Public methodSetPageSize
Sets the page size for this query. The page size controls how much resulting rows will be retrieved simultaneously (the goal being to avoid loading too much results in memory for queries yielding large results). Please note that while value as low as 1 can be used, it is highly discouraged to use such a low value in practice as it will yield very poor performance. If in doubt, leaving the default is probably a good idea.

Also note that only SELECT queries ever make use of that setting.

the page size to use. If set to 0 or less, the default value will be used. To disable paging of the result set, use int.MaxValue

Return Value

Type: 
this Query object.
(Inherited from Statement.)
Public methodSetPagingState
Sets the paging state, a token representing the current page state of query used to continue paging by retrieving the following result page. Setting the paging state will disable automatic paging.
(Inherited from Statement.)
Public methodSetQueryString
Public methodSetReadTimeoutMillis
Overrides the default per-host read timeout ReadTimeoutMillis for this statement.
(Inherited from Statement.)
Public methodSetRetryPolicy
Sets the retry policy to use for this query.

Calling this method is only required when you want to override the default RetryPolicy set in the cluster configuration for this request.

Use a IExtendedRetryPolicy implementation to cover all error scenarios.

(Inherited from Statement.)
Public methodSetRoutingKey
Set the routing key for this query.

This method allows to manually provide a routing key for this query. It is thus optional since the routing key is only an hint for token aware load balancing policy but is never mandatory.

If the partition key for the query is composite, use the #setRoutingKey(ByteBuffer...) method instead to build the routing key.

Public methodSetRoutingValues
Sets the partition key values in order to route the query to the correct replicas.

For simple partition keys, set the partition key value.

For composite partition keys, set the multiple the partition key values in correct order.

Public methodSetSerialConsistencyLevel
Sets the serial consistency level for the query. The serial consistency level is only used by conditional updates (so INSERT, UPDATE and DELETE with an IF condition). For those, the serial consistency level defines the consistency level of the serial phase (or "paxos" phase) while the normal consistency level defines the consistency for the "learn" phase, i.e. what type of reads will be guaranteed to see the update right away. For instance, if a conditional write has a regular consistency of QUORUM (and is successful), then a QUORUM read is guaranteed to see that write. But if the regular consistency of that write is ANY, then only a read with a consistency of SERIAL is guaranteed to see it (even a read with consistency ALL is not guaranteed to be enough).
(Inherited from Statement.)
Public methodSetTimestamp
Sets the timestamp associated with this statement execution. If provided, this will replace the server side assigned timestamp as default timestamp. Note that a timestamp in the query itself will still override this timestamp.
(Inherited from Statement.)
Public methodToString (Inherited from RegularStatement.)
Top
See Also

Reference