Class SimplePreparedStatementCreator
java.lang.Object
org.springframework.data.cassandra.core.cql.SimplePreparedStatementCreator
- All Implemented Interfaces:
CqlProvider
,PreparedStatementCreator
public class SimplePreparedStatementCreator
extends Object
implements PreparedStatementCreator, CqlProvider
Trivial implementation of
PreparedStatementCreator
. This prepared statement creator simply prepares a
statement from the CQL string. Exposes the given CQL statement through CqlProvider.getCql()
,- Author:
- David Webb, Mark Paluch
- See Also:
-
Constructor Summary
ConstructorDescriptionSimplePreparedStatementCreator
(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Create aSimplePreparedStatementCreator
givencql
.Create aSimplePreparedStatementCreator
givencql
. -
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.cql.PreparedStatement
createPreparedStatement
(com.datastax.oss.driver.api.core.CqlSession session) Create a statement in this session.getCql()
Return the CQL string for this object, i.e. typically the CQL used for creating statements.
-
Constructor Details
-
SimplePreparedStatementCreator
Create aSimplePreparedStatementCreator
givencql
.- Parameters:
cql
- must not be null.
-
SimplePreparedStatementCreator
public SimplePreparedStatementCreator(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Create aSimplePreparedStatementCreator
givencql
.- Parameters:
statement
- must not be null.- Since:
- 3.1
-
-
Method Details
-
createPreparedStatement
public 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 Description copied from interface:PreparedStatementCreator
Create a statement in this session. Allows implementations to usePreparedStatement
.- Specified by:
createPreparedStatement
in interfacePreparedStatementCreator
- Parameters:
session
-CqlSession
to use to create statement.- Returns:
- a prepared statement.
- Throws:
com.datastax.oss.driver.api.core.DriverException
- there is no need to catchDriverException
that may be thrown in the implementation of this method. TheCqlTemplate
class will handle them.
-
getCql
Description copied from interface:CqlProvider
Return the CQL string for this object, i.e. typically the CQL used for creating statements.- Specified by:
getCql
in interfaceCqlProvider
- Returns:
- the CQL string.
-