Interface BoundStatement
-
- All Superinterfaces:
AccessibleById,AccessibleByIndex,AccessibleByName,BatchableStatement<BoundStatement>,Bindable<BoundStatement>,Data,GettableById,GettableByIndex,GettableByName,Request,SettableById<BoundStatement>,SettableByIndex<BoundStatement>,SettableByName<BoundStatement>,Statement<BoundStatement>
public interface BoundStatement extends BatchableStatement<BoundStatement>, Bindable<BoundStatement>
A prepared statement in its executable form, with values bound to the variables.The default implementation returned by the driver is immutable and thread-safe. All mutating methods return a new instance.
-
-
Field Summary
-
Fields inherited from interface com.datastax.oss.driver.api.core.cql.Statement
ASYNC, NO_DEFAULT_TIMESTAMP, NO_NOW_IN_SECONDS, SYNC
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcomputeSizeInBytes(DriverContext context)Calculates the approximate size in bytes that the statement will have when encoded.default CqlIdentifiergetKeyspace()Always returnsnull(bound statements can't have a per-request keyspace, they always inherit the one of the statement that was initially prepared).PreparedStatementgetPreparedStatement()The prepared statement that was used to create this statement.List<ByteBuffer>getValues()The values to bind, in their serialized form.-
Methods inherited from interface com.datastax.oss.driver.api.core.data.AccessibleById
allIndicesOf, firstIndexOf
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.AccessibleByIndex
getType, size
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.AccessibleByName
allIndicesOf, firstIndexOf
-
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.Data
codecRegistry, protocolVersion
-
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, 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.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.session.Request
getCustomPayload, getExecutionProfile, getExecutionProfileName, getNode, getPartitioner, getRequestRoutingType, getRoutingKey, getRoutingKeyspace, getRoutingTable, getRoutingToken, getTimeout, isIdempotent
-
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, 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.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
-
Methods inherited from interface com.datastax.oss.driver.api.core.cql.Statement
copy, disableTracing, enableTracing, getConsistencyLevel, getDefaultTimestamp, getFetchSize, getNowInSeconds, getPageSize, getPagingState, getQueryTimestamp, getSerialConsistencyLevel, isLWT, isTracing, setConsistencyLevel, setCustomPayload, setDefaultTimestamp, setExecutionProfile, setExecutionProfileName, setFetchSize, setIdempotent, setNode, setNowInSeconds, setPageSize, setPagingState, setPagingState, setPagingState, setQueryTimestamp, setRequestRoutingType, setRoutingKey, setRoutingKey, setRoutingKeyspace, setRoutingKeyspace, setRoutingToken, setSerialConsistencyLevel, setTimeout, setTracing
-
-
-
-
Method Detail
-
getPreparedStatement
@NonNull PreparedStatement getPreparedStatement()
The prepared statement that was used to create this statement.
-
getValues
@NonNull List<ByteBuffer> getValues()
The values to bind, in their serialized form.
-
getKeyspace
@Nullable default CqlIdentifier getKeyspace()
Always returnsnull(bound statements can't have a per-request keyspace, they always inherit the one of the statement that was initially prepared).- Specified by:
getKeyspacein interfaceRequest- See Also:
- CASSANDRA-10145
-
computeSizeInBytes
default int computeSizeInBytes(@NonNull DriverContext context)Description copied from interface:StatementCalculates the approximate size in bytes that the statement will have when encoded.The size might be over-estimated by a few bytes due to global options that may be defined on a
Sessionbut not explicitly set on the statement itself.The result of this method is not cached, calling it will cause some encoding to be done in order to determine some of the statement's attributes sizes. Therefore, use this method sparingly in order to avoid unnecessary computation.
- Specified by:
computeSizeInBytesin interfaceStatement<BoundStatement>- Returns:
- the approximate number of bytes this statement will take when encoded.
-
-