Click or drag to resize

BoundStatement Class

Represents a prepared statement with the parameter values set, ready for execution.

A BoundStatement can be created from a PreparedStatement instance using the Bind() method and can be executed using a ISession instance.
Inheritance Hierarchy
SystemObject
  DseStatement
    DseBoundStatement

Namespace:  Dse
Assembly:  Dse (in Dse.dll) Version: 2.9.0
Syntax
C#
public class BoundStatement : Statement

The BoundStatement type exposes the following members.

Constructors
  NameDescription
Public methodBoundStatement
Initializes a new instance of the Cassandra.BoundStatement class
Public methodBoundStatement(PreparedStatement)
Creates a new BoundStatement from the provided prepared statement.
Top
Properties
  NameDescription
Public propertyKeyspace
Returns the keyspace this query operates on, based on the PreparedStatement metadata.

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

(Overrides StatementKeyspace.)
Public propertyPreparedStatement
Gets the prepared statement on which this BoundStatement is based.
Public propertyRoutingKey
Gets the routing key for this bound query.

This method will return a non-null value if:

  • either all the TableColumns composing the partition key are bound variables of this BoundStatement. The routing key will then be built using the values provided for these partition key TableColumns.
  • or the routing key has been set through PreparedStatement.SetRoutingKey for the PreparedStatement this statement has been built from.
Otherwise, null is returned.

Note that if the routing key has been set through PreparedStatement.SetRoutingKey, that value takes precedence even if the partition key is part of the bound variables.

(Overrides StatementRoutingKey.)
Top
Methods
  NameDescription
Public methodSetRoutingKey
Set the routing key for this query. This method allows to manually provide a routing key for this BoundStatement. It is thus optional since the routing key is only an hint for token aware load balancing policy but is never mandatory.
Top
See Also