Click or drag to resize
BoundStatement Class
A prepared statement with values bound to the bind variables.

Once a BoundStatement has values for all the variables of the PreparedStatement it has been created from, it can executed (through Execute(IStatement)).

The values of a BoundStatement can be set by either index or name. When setting them by name, names follow the case insensitivity rules explained in ColumnDefinitions. Note-worthily, if multiple bind variables correspond to the same column (as would be the case if you prepare SELECT * FROM t WHERE x > ? AND x < ?), you will have to set values by indexes (or the PreparedStatement.Bind(object[]) method) as the methods to set by name only allows to set the first prepared occurrence of the column.

Inheritance Hierarchy
SystemObject
  CassandraStatement
    CassandraBoundStatement

Namespace: Cassandra
Assembly: Cassandra (in Cassandra.dll) Version: 3.4.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
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
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
See Also