Class BoundStatement
Represents a prepared statement with the parameter values set, ready for execution.
A BoundStatement can be created from a PreparedStatement instance using theBind()
method and can be executed using a ISession instance.
PreparedStatement
Implements
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public class BoundStatement : Statement, IStatement
Constructors
BoundStatement()
Initializes a new instance of the Cassandra.BoundStatement class
Declaration
public BoundStatement()
BoundStatement(PreparedStatement)
Creates a new BoundStatement
from the provided prepared
statement.
Declaration
public BoundStatement(PreparedStatement statement)
Parameters
Type | Name | Description |
---|---|---|
PreparedStatement | statement | the prepared statement from which to create a |
Properties
Keyspace
Returns the keyspace this query operates on, based on the PreparedStatement metadata.
The keyspace returned is used as a hint for token-aware routing.
Declaration
public override string Keyspace { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
PreparedStatement
Gets the prepared statement on which this BoundStatement is based.
Declaration
public PreparedStatement PreparedStatement { get; }
Property Value
Type | Description |
---|---|
PreparedStatement |
RoutingKey
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.
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.
Declaration
public override RoutingKey RoutingKey { get; }
Property Value
Type | Description |
---|---|
RoutingKey |
Overrides
Methods
SetRoutingKey(params RoutingKey[])
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.
Declaration
public BoundStatement SetRoutingKey(params RoutingKey[] routingKeyComponents)
Parameters
Type | Name | Description |
---|---|---|
RoutingKey[] | routingKeyComponents | the raw (binary) values to compose the routing key. |
Returns
Type | Description |
---|---|
BoundStatement |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |