public abstract class RegularStatement extends Statement
getValues
). It can be extended but SimpleStatement
is provided as a simple implementation to build a RegularStatement
directly
from its query string.idempotent
Modifier | Constructor and Description |
---|---|
protected |
RegularStatement()
Creates a new RegularStatement.
|
Modifier and Type | Method and Description |
---|---|
abstract String |
getQueryString()
Returns the query string for this statement.
|
ByteBuffer[] |
getValues()
Deprecated.
This method is provided for binary compatibility only. It is no longer supported, will be removed,
and simply throws
UnsupportedOperationException . Use getValues(ProtocolVersion) instead. |
ByteBuffer[] |
getValues(int protocolVersion)
Deprecated.
This method is provided for backward compatibility. Use
getValues(ProtocolVersion) instead. |
abstract ByteBuffer[] |
getValues(ProtocolVersion protocolVersion)
The values to use for this statement.
|
abstract boolean |
hasValues()
Whether or not this statement has values, that is if
getValues
will return null or not. |
String |
toString()
Returns this statement as a CQL query string.
|
disableTracing, enableTracing, getConsistencyLevel, getDefaultTimestamp, getFetchSize, getKeyspace, getRetryPolicy, getRoutingKey, getSerialConsistencyLevel, isIdempotent, isTracing, setConsistencyLevel, setDefaultTimestamp, setFetchSize, setIdempotent, setPagingState, setPagingStateUnsafe, setRetryPolicy, setSerialConsistencyLevel
public abstract String getQueryString()
Statement
objects.
For example, Statement
objects carry numerous protocol-level
settings, such as the consistency level
to use,
or the idempotence flag
, among others.
None of these settings will be included in the resulting query string.
Similarly, if values have been set on this statement because
it has bind markers, these values will not appear in the resulting query string.
Note: the consistency level was conveyed at CQL level in older versions
of the CQL grammar, but since CASSANDRA-4734
it is now a protocol-level setting and consequently does not appear in the query string.public abstract ByteBuffer[] getValues(ProtocolVersion protocolVersion)
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).protocolVersion
- the protocol version in which the returned values
must be serialized for.null
if there is
no such values.SimpleStatement.SimpleStatement(String, Object...)
@Deprecated public ByteBuffer[] getValues(int protocolVersion)
getValues(ProtocolVersion)
instead.IllegalArgumentException
- if protocolVersion
does not correspond to any known version.@Deprecated public ByteBuffer[] getValues()
UnsupportedOperationException
. Use getValues(ProtocolVersion)
instead.public abstract boolean hasValues()
getValues
will return null
or not.false
if getValues(com.datastax.driver.core.ProtocolVersion)
returns null
, true
otherwise.public String toString()
Statement
objects.
See the javadocs of getQueryString()
for more information.toString
in class Object
getQueryString()