Class CachedPreparedStatementCreator
java.lang.Object
org.springframework.data.cassandra.core.cql.CachedPreparedStatementCreator
- All Implemented Interfaces:
PreparedStatementCreator
@Deprecated
public class CachedPreparedStatementCreator
extends Object
implements PreparedStatementCreator
Deprecated.
since 2.0. This class uses an unsafe, static held cache.
This
PreparedStatementCreator
maintains a static cache of all prepared statements for the duration of the JVM
runtime, more specific the lifecycle of the associated ClassLoader
. When preparing statements with Cassandra,
each Statement should be prepared once and only once due to the overhead of preparing the statement.
CachedPreparedStatementCreator
is thread-safe and does not require external synchronization when used by
concurrent threads.
- Author:
- David Webb, Mark Paluch
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.cql.PreparedStatement
createPreparedStatement
(com.datastax.oss.driver.api.core.CqlSession session) Deprecated.Create a statement in this session.getCql()
Deprecated.Returns the CQL statement on which thePreparedStatement
will be based.
-
Field Details
-
log
Deprecated.
-
-
Constructor Details
-
CachedPreparedStatementCreator
Deprecated.Create aPreparedStatementCreator
from the provided CQL.- Parameters:
cql
- must not be empty or null.
-
-
Method Details
-
getCql
Deprecated.Returns the CQL statement on which thePreparedStatement
will be based.- Returns:
- a String containing the CQL of the
PreparedStatement
.
-
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 Deprecated.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.
-