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(ProtocolVersion protocolVersion,
CodecRegistry codecRegistry)
Returns the first non-null routing key of the statements in this batch
or null otherwise.
|
ByteBuffer[] |
getValues(ProtocolVersion protocolVersion,
CodecRegistry codecRegistry)
The positional values to use for this statement.
|
Batch.Options |
using(Using using)
Adds a new options for this BATCH statement.
|
escapeId, getNamedValues, getObject, getObject, getQueryString, hasValues, isIdempotent, setForceNoValues, toString, usesNamedValues
getQueryString, hasValues
disableTracing, enableTracing, getConsistencyLevel, getDefaultTimestamp, getFetchSize, getOutgoingPayload, getReadTimeoutMillis, getRetryPolicy, getSerialConsistencyLevel, isTracing, setConsistencyLevel, setDefaultTimestamp, setFetchSize, setIdempotent, setOutgoingPayload, setPagingState, setPagingState, setPagingStateUnsafe, setReadTimeoutMillis, 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(ProtocolVersion protocolVersion, CodecRegistry codecRegistry)
RegularStatement
RegularStatement.getNamedValues(ProtocolVersion, CodecRegistry)
will return null
.
Values for a RegularStatement (i.e. if either 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 forced version
1 through Cluster.Builder.withProtocolVersion(com.datastax.driver.core.ProtocolVersion)
or you use
Cassandra 1.2).getValues
in class BuiltStatement
protocolVersion
- the protocol version that will be used to serialize
the values.codecRegistry
- the codec registry that will be used to serialize the
values.SimpleStatement.SimpleStatement(String, Object...)
public Batch.Options using(Using using)
using
- the option to add.public ByteBuffer getRoutingKey(ProtocolVersion protocolVersion, CodecRegistry codecRegistry)
getRoutingKey
in class BuiltStatement
protocolVersion
- the protocol version that will be used if the actual
implementation needs to serialize something to compute
the key.codecRegistry
- the codec registry that will be used if the actual
implementation needs to serialize something to compute
this key.public String getKeyspace()
getKeyspace
in class BuiltStatement