com.datastax.driver.core
Class RegularStatement

java.lang.Object
  extended by com.datastax.driver.core.Statement
      extended by com.datastax.driver.core.RegularStatement
Direct Known Subclasses:
BuiltStatement, SimpleStatement

public abstract class RegularStatement
extends Statement

A regular (non-prepared and non batched) CQL statement.

This class represents a query string along with query options (and optionally binary values, see getValues). It can be extended but SimpleStatement is provided as a simple implementation to build a RegularStatement directly from its query string.


Constructor Summary
protected RegularStatement()
          Creates a new RegularStatement.
 
Method Summary
abstract  String getQueryString()
          Returns the query string for this statement.
abstract  ByteBuffer[] getValues()
          The values to use for this statement.
 String toString()
           
 
Methods inherited from class com.datastax.driver.core.Statement
disableTracing, enableTracing, getConsistencyLevel, getFetchSize, getKeyspace, getRetryPolicy, getRoutingKey, getSerialConsistencyLevel, isTracing, setConsistencyLevel, setFetchSize, setRetryPolicy, setSerialConsistencyLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegularStatement

protected RegularStatement()
Creates a new RegularStatement.

Method Detail

getQueryString

public abstract String getQueryString()
Returns the query string for this statement.

Returns:
a valid CQL query string.

getValues

public abstract ByteBuffer[] getValues()
The values to use for this statement.

Note: Values for a RegularStatement (i.e. if this method does not return null) are not supported with the native protocol version 1: you will get an UnsupportedProtocolVersionException when submitting one if version 1 of the protocol is in use (i.e. if you've force version 1 through Cluster.Builder.withProtocolVersion(int) or you use Cassandra 1.2).

Returns:
the values to use for this statement or null if there is no such values.
See Also:
SimpleStatement.SimpleStatement(String, Object...)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All rights reserved.