public class Batch extends BuiltStatement
Modifier and Type | Class and Description |
---|---|
static class |
Batch.Options
The options of a BATCH statement.
|
idempotent, NULL_PAYLOAD_VALUE
Modifier and Type | Method and Description |
---|---|
Batch |
add(RegularStatement statement)
Adds a new statement to this batch.
|
String |
getKeyspace()
Returns the keyspace of the first statement in this batch.
|
ByteBuffer |
getRoutingKey()
Returns the first non-null routing key of the statements in this batch
or null otherwise.
|
ByteBuffer[] |
getValues()
The values to use for this statement.
|
Batch.Options |
using(Using using)
Adds a new options for this BATCH statement.
|
escapeId, getQueryString, hasValues, isIdempotent, setForceNoValues, toString
disableTracing, enableTracing, getConsistencyLevel, getDefaultTimestamp, getFetchSize, getRetryPolicy, getSerialConsistencyLevel, isTracing, setConsistencyLevel, setDefaultTimestamp, setFetchSize, setIdempotent, setOutgoingPayload, setPagingState, setPagingStateUnsafe, setRetryPolicy, setSerialConsistencyLevel
public Batch add(RegularStatement statement)
statement
- the new statement to add.IllegalArgumentException
- if counter and non-counter operations
are mixed.public ByteBuffer[] getValues()
BuiltStatement
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(com.datastax.driver.core.ProtocolVersion)
or you use
Cassandra 1.2).
Note: Calling this method may trigger the underlying Cluster
initialization.
getValues
in class BuiltStatement
SimpleStatement.SimpleStatement(String, Cluster, Object...)
public Batch.Options using(Using using)
using
- the option to add.public ByteBuffer getRoutingKey()
getRoutingKey
in class BuiltStatement
public String getKeyspace()
getKeyspace
in class BuiltStatement
Copyright © 2012–2015. All rights reserved.