Class BoundStatementBuilder
- java.lang.Object
-
- com.datastax.oss.driver.api.core.cql.StatementBuilder<BoundStatementBuilder,BoundStatement>
-
- com.datastax.oss.driver.api.core.cql.BoundStatementBuilder
-
- All Implemented Interfaces:
Bindable<BoundStatementBuilder>,AccessibleById,AccessibleByIndex,AccessibleByName,Data,GettableById,GettableByIndex,GettableByName,SettableById<BoundStatementBuilder>,SettableByIndex<BoundStatementBuilder>,SettableByName<BoundStatementBuilder>
@NotThreadSafe public class BoundStatementBuilder extends StatementBuilder<BoundStatementBuilder,BoundStatement> implements Bindable<BoundStatementBuilder>
A builder to create a bound statement.This class is mutable and not thread-safe.
-
-
Field Summary
-
Fields inherited from class com.datastax.oss.driver.api.core.cql.StatementBuilder
consistencyLevel, executionProfile, executionProfileName, idempotent, node, nowInSeconds, pageSize, pagingState, requestRoutingType, routingKey, routingKeyspace, routingToken, serialConsistencyLevel, timeout, timestamp, tracing
-
-
Constructor Summary
Constructors Constructor Description BoundStatementBuilder(BoundStatement template)BoundStatementBuilder(PreparedStatement preparedStatement, ColumnDefinitions variableDefinitions, ByteBuffer[] values, String executionProfileName, DriverExecutionProfile executionProfile, CqlIdentifier routingKeyspace, ByteBuffer routingKey, Token routingToken, Map<String,ByteBuffer> customPayload, Boolean idempotent, boolean tracing, long timestamp, ByteBuffer pagingState, int pageSize, ConsistencyLevel consistencyLevel, ConsistencyLevel serialConsistencyLevel, Duration timeout, CodecRegistry codecRegistry, ProtocolVersion protocolVersion, RequestRoutingType requestRoutingType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Integer>allIndicesOf(CqlIdentifier id)Returns all the indices where a given identifier appears.List<Integer>allIndicesOf(String name)Returns all the indices where a given identifier appears.BoundStatementbuild()CodecRegistrycodecRegistry()Returns the registry of all the codecs currently available to convert values for this instance.intfirstIndexOf(CqlIdentifier id)Returns the first index where a given identifier appears (depending on the implementation, identifiers may appear multiple times).intfirstIndexOf(String name)Returns the first index where a given identifier appears (depending on the implementation, identifiers may appear multiple times).ByteBuffergetBytesUnsafe(int i)Returns the raw binary representation of theith value.PreparedStatementgetPreparedStatement()The prepared statement that was used to create this statement.DataTypegetType(int i)Returns the CQL type of theith value.ProtocolVersionprotocolVersion()Returns the protocol version that is currently used to convert values for this instance.BoundStatementBuildersetBytesUnsafe(int i, ByteBuffer v)Sets the raw binary representation of theith value.intsize()Returns the number of values.-
Methods inherited from class com.datastax.oss.driver.api.core.cql.StatementBuilder
addCustomPayload, buildCustomPayload, clearCustomPayload, disableTracing, enableTracing, setConsistencyLevel, setDefaultTimestamp, setExecutionProfile, setExecutionProfileName, setFetchSize, setIdempotence, setNode, setNowInSeconds, setPageSize, setPagingState, setQueryTimestamp, setRequestRoutingType, setRoutingKey, setRoutingKey, setRoutingKeyspace, setRoutingKeyspace, setRoutingToken, setSerialConsistencyLevel, setTimeout, setTracing, setTracing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.datastax.oss.driver.api.core.cql.Bindable
isSet, isSet, isSet, unset, unset, unset
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.GettableById
get, get, get, getBigDecimal, getBigInteger, getBool, getBoolean, getByte, getByteBuffer, getBytesUnsafe, getCqlDuration, getDouble, getFloat, getInetAddress, getInstant, getInt, getList, getLocalDate, getLocalTime, getLong, getMap, getObject, getSet, getShort, getString, getToken, getTupleValue, getUdtValue, getUuid, getVector, isNull
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.GettableByIndex
get, get, get, getBigDecimal, getBigInteger, getBool, getBoolean, getByte, getByteBuffer, getCqlDuration, getDouble, getFloat, getInetAddress, getInstant, getInt, getList, getLocalDate, getLocalTime, getLong, getMap, getObject, getSet, getShort, getString, getToken, getTupleValue, getUdtValue, getUuid, getVector, isNull
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.GettableByName
get, get, get, getBigDecimal, getBigInteger, getBool, getBoolean, getByte, getByteBuffer, getBytesUnsafe, getCqlDuration, getDouble, getFloat, getInetAddress, getInstant, getInt, getList, getLocalDate, getLocalTime, getLong, getMap, getObject, getSet, getShort, getString, getToken, getTupleValue, getUdtValue, getUuid, getVector, isNull
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.SettableById
getType, set, set, set, setBigDecimal, setBigInteger, setBool, setBoolean, setByte, setByteBuffer, setBytesUnsafe, setCqlDuration, setDouble, setFloat, setInetAddress, setInstant, setInt, setList, setLocalDate, setLocalTime, setLong, setMap, setSet, setShort, setString, setToken, setToNull, setTupleValue, setUdtValue, setUuid, setVector
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.SettableByIndex
set, set, set, setBigDecimal, setBigInteger, setBool, setBoolean, setByte, setByteBuffer, setCqlDuration, setDouble, setFloat, setInetAddress, setInstant, setInt, setList, setLocalDate, setLocalTime, setLong, setMap, setSet, setShort, setString, setToken, setToNull, setTupleValue, setUdtValue, setUuid, setVector
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.SettableByName
getType, set, set, set, setBigDecimal, setBigInteger, setBool, setBoolean, setByte, setByteBuffer, setBytesUnsafe, setCqlDuration, setDouble, setFloat, setInetAddress, setInstant, setInt, setList, setLocalDate, setLocalTime, setLong, setMap, setSet, setShort, setString, setToken, setToNull, setTupleValue, setUdtValue, setUuid, setVector
-
-
-
-
Constructor Detail
-
BoundStatementBuilder
public BoundStatementBuilder(@NonNull PreparedStatement preparedStatement, @NonNull ColumnDefinitions variableDefinitions, @NonNull ByteBuffer[] values, @Nullable String executionProfileName, @Nullable DriverExecutionProfile executionProfile, @Nullable CqlIdentifier routingKeyspace, @Nullable ByteBuffer routingKey, @Nullable Token routingToken, @NonNull Map<String,ByteBuffer> customPayload, @Nullable Boolean idempotent, boolean tracing, long timestamp, @Nullable ByteBuffer pagingState, int pageSize, @Nullable ConsistencyLevel consistencyLevel, @Nullable ConsistencyLevel serialConsistencyLevel, @Nullable Duration timeout, @NonNull CodecRegistry codecRegistry, @NonNull ProtocolVersion protocolVersion, @Nullable RequestRoutingType requestRoutingType)
-
BoundStatementBuilder
public BoundStatementBuilder(@NonNull BoundStatement template)
-
-
Method Detail
-
getPreparedStatement
@NonNull public PreparedStatement getPreparedStatement()
The prepared statement that was used to create this statement.
-
allIndicesOf
@NonNull public List<Integer> allIndicesOf(@NonNull CqlIdentifier id)
Description copied from interface:AccessibleByIdReturns all the indices where a given identifier appears.- Specified by:
allIndicesOfin interfaceAccessibleById
-
firstIndexOf
public int firstIndexOf(@NonNull CqlIdentifier id)Description copied from interface:AccessibleByIdReturns the first index where a given identifier appears (depending on the implementation, identifiers may appear multiple times).- Specified by:
firstIndexOfin interfaceAccessibleById
-
allIndicesOf
@NonNull public List<Integer> allIndicesOf(@NonNull String name)
Description copied from interface:AccessibleByNameReturns all the indices where a given identifier appears.- Specified by:
allIndicesOfin interfaceAccessibleByName
-
firstIndexOf
public int firstIndexOf(@NonNull String name)Description copied from interface:AccessibleByNameReturns the first index where a given identifier appears (depending on the implementation, identifiers may appear multiple times).- Specified by:
firstIndexOfin interfaceAccessibleByName
-
setBytesUnsafe
@NonNull public BoundStatementBuilder setBytesUnsafe(int i, ByteBuffer v)
Description copied from interface:SettableByIndexSets the raw binary representation of theith value.This is primarily for internal use; you'll likely want to use one of the typed setters instead, to pass a higher-level Java representation.
- Specified by:
setBytesUnsafein interfaceSettableByIndex<BoundStatementBuilder>v- the raw value, ornullto set the CQL valueNULL. For performance reasons, this is the actual instance used internally. If pass in a buffer that you're going to modify elsewhere in your application, make sure toduplicateit beforehand. If you change the buffer's index or its contents in any way, further usage of this data will have unpredictable results.
-
getBytesUnsafe
public ByteBuffer getBytesUnsafe(int i)
Description copied from interface:GettableByIndexReturns the raw binary representation of theith value.This is primarily for internal use; you'll likely want to use one of the typed getters instead, to get a higher-level Java representation.
- Specified by:
getBytesUnsafein interfaceGettableByIndex- Returns:
- the raw value, or
nullif the CQL value isNULL. For performance reasons, this is the actual instance used internally. If you read data from the buffer, make sure toduplicateit beforehand, or only use relative methods. If you change the buffer's index or its contents in any way, any other getter invocation for this value will have unpredictable results.
-
size
public int size()
Description copied from interface:AccessibleByIndexReturns the number of values.- Specified by:
sizein interfaceAccessibleByIndex
-
getType
@NonNull public DataType getType(int i)
Description copied from interface:AccessibleByIndexReturns the CQL type of theith value.- Specified by:
getTypein interfaceAccessibleByIndex
-
codecRegistry
@NonNull public CodecRegistry codecRegistry()
Description copied from interface:DataReturns the registry of all the codecs currently available to convert values for this instance.If you obtained this object from the driver, this will be set automatically. If you created it manually, or just deserialized it, it is set to
CodecRegistry.DEFAULT. You can reattach this object to an existing driver instance to use its codec registry.- Specified by:
codecRegistryin interfaceData- See Also:
Detachable
-
protocolVersion
@NonNull public ProtocolVersion protocolVersion()
Description copied from interface:DataReturns the protocol version that is currently used to convert values for this instance.If you obtained this object from the driver, this will be set automatically. If you created it manually, or just deserialized it, it is set to
ProtocolVersion.DEFAULT. You can reattach this object to an existing driver instance to use its protocol version.- Specified by:
protocolVersionin interfaceData- See Also:
Detachable
-
build
@NonNull public BoundStatement build()
- Specified by:
buildin classStatementBuilder<BoundStatementBuilder,BoundStatement>
-
-