public static class AsyncCassandraTemplate.PreparedStatementHandler extends Object implements AsyncCassandraTemplate.AsyncPreparedStatementHandler
SimpleStatement
and bind values associated with the statement to a
BoundStatement
.Constructor and Description |
---|
PreparedStatementHandler(com.datastax.oss.driver.api.core.cql.Statement<?> statement,
PersistenceExceptionTranslator exceptionTranslator) |
Modifier and Type | Method and Description |
---|---|
com.datastax.oss.driver.api.core.cql.BoundStatement |
bindValues(com.datastax.oss.driver.api.core.cql.PreparedStatement ps)
Bind parameter values on the given
PreparedStatement . |
ListenableFuture<com.datastax.oss.driver.api.core.cql.PreparedStatement> |
createPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session)
Create a statement in this session.
|
protected CompletionStage<com.datastax.oss.driver.api.core.cql.PreparedStatement> |
doPrepare(com.datastax.oss.driver.api.core.CqlSession session)
Invokes the statement preparation.
|
String |
getCql()
Return the CQL string for this object, i.e. typically the CQL used for creating statements.
|
public PreparedStatementHandler(com.datastax.oss.driver.api.core.cql.Statement<?> statement, PersistenceExceptionTranslator exceptionTranslator)
public ListenableFuture<com.datastax.oss.driver.api.core.cql.PreparedStatement> createPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session) throws com.datastax.oss.driver.api.core.DriverException
AsyncPreparedStatementCreator
PreparedStatement
s. The
CqlTemplate
will attempt to cache the PreparedStatement
s for future use without the overhead of
re-preparing on the entire cluster.createPreparedStatement
in interface AsyncPreparedStatementCreator
session
- Session to use to create statement, must not be null.com.datastax.oss.driver.api.core.DriverException
- there is no need to catch DriverException that may be thrown in the implementation of this
method. The AsyncCqlTemplate
class will handle them.protected CompletionStage<com.datastax.oss.driver.api.core.cql.PreparedStatement> doPrepare(com.datastax.oss.driver.api.core.CqlSession session)
session
- public com.datastax.oss.driver.api.core.cql.BoundStatement bindValues(com.datastax.oss.driver.api.core.cql.PreparedStatement ps) throws com.datastax.oss.driver.api.core.DriverException
PreparedStatementBinder
PreparedStatement
.bindValues
in interface PreparedStatementBinder
ps
- the PreparedStatement to invoke setter methods on.com.datastax.oss.driver.api.core.DriverException
- if a DriverException
is encountered (i.e. there is no need to catch
DriverException
)public String getCql()
CqlProvider
getCql
in interface CqlProvider
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.