|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datastax.driver.core.Query
com.datastax.driver.core.Statement
com.datastax.driver.core.SimpleStatement
public class SimpleStatement
A simple Statement
implementation built directly from a query
string.
Constructor Summary | |
---|---|
SimpleStatement(String query)
Creates a new SimpleStatement with the provided query string. |
Method Summary | |
---|---|
String |
getQueryString()
Returns the query string. |
ByteBuffer |
getRoutingKey()
Returns the routing key for the query. |
SimpleStatement |
setRoutingKey(ByteBuffer... routingKeyComponents)
Sets the routing key for this query. |
SimpleStatement |
setRoutingKey(ByteBuffer routingKey)
Sets the routing key for this query. |
Methods inherited from class com.datastax.driver.core.Statement |
---|
toString |
Methods inherited from class com.datastax.driver.core.Query |
---|
disableTracing, enableTracing, getConsistencyLevel, getRetryPolicy, isTracing, setConsistencyLevel, setRetryPolicy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleStatement(String query)
SimpleStatement
with the provided query string.
query
- the query string.Method Detail |
---|
public String getQueryString()
getQueryString
in class Statement
public ByteBuffer getRoutingKey()
Unless the routing key has been explicitly set through
setRoutingKey(java.nio.ByteBuffer)
, this method will return null
to
avoid having to parse the query string to retrieve the partition key.
getRoutingKey
in class Query
setRoutingKey(java.nio.ByteBuffer)
is such a key
was set, null
otherwise.Query.getRoutingKey()
public SimpleStatement setRoutingKey(ByteBuffer routingKey)
This method allows you 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.
routingKey
- the raw (binary) value to use as routing key.
SimpleStatement
object.Query.getRoutingKey()
public SimpleStatement setRoutingKey(ByteBuffer... routingKeyComponents)
See setRoutingKey(ByteBuffer)
for more information. This
method is a variant for when the query partition key is composite and
thus the routing key must be built from multiple values.
routingKeyComponents
- the raw (binary) values to compose to obtain
the routing key.
SimpleStatement
object.Query.getRoutingKey()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |