com.datastax.driver.core.querybuilder
Class Batch

java.lang.Object
  extended by com.datastax.driver.core.Query
      extended by com.datastax.driver.core.Statement
          extended by com.datastax.driver.core.querybuilder.Batch

public class Batch
extends Statement

A built BATCH statement.


Nested Class Summary
static class Batch.Options
          The options of a BATCH statement.
 
Field Summary
protected  Boolean isCounterOp
           
 
Method Summary
 Batch add(Statement statement)
          Adds a new statement to this batch.
protected  String buildQueryString()
           
 String getQueryString()
          Returns the query string for this statement.
 ByteBuffer getRoutingKey()
          Returns the first non-null routing key of the statements in this batch or null otherwise.
protected  boolean isCounterOp()
           
protected  void setCounterOp(boolean isCounterOp)
           
protected  void setDirty()
           
 Batch.Options using(Using using)
          Adds a new options for this BATCH statement.
 
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
 

Field Detail

isCounterOp

protected Boolean isCounterOp
Method Detail

buildQueryString

protected String buildQueryString()

add

public Batch add(Statement statement)
Adds a new statement to this batch.

Parameters:
statement - the new statement to add.
Returns:
this batch.
Throws:
IllegalArgumentException - if counter and non-counter operations are mixed.

using

public Batch.Options using(Using using)
Adds a new options for this BATCH statement.

Parameters:
using - the option to add.
Returns:
the options of this BATCH statement.

getRoutingKey

public ByteBuffer getRoutingKey()
Returns the first non-null routing key of the statements in this batch or null otherwise.

Returns:
the routing key for this batch statement.

getQueryString

public String getQueryString()
Description copied from class: Statement
Returns the query string for this statement.

Specified by:
getQueryString in class Statement
Returns:
a valid CQL query string.

setDirty

protected void setDirty()

isCounterOp

protected boolean isCounterOp()

setCounterOp

protected void setCounterOp(boolean isCounterOp)


Copyright © 2013. All Rights Reserved.