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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.cql.PreparedStatementcreatePreparedStatement(com.datastax.oss.driver.api.core.CqlSession session) Deprecated.Create a statement in this session.getCql()Deprecated.Returns the CQL statement on which thePreparedStatementwill be based.
-
Field Details
-
log
Deprecated.
-
-
Constructor Details
-
CachedPreparedStatementCreator
Deprecated.Create aPreparedStatementCreatorfrom the provided CQL.- Parameters:
cql- must not be empty or null.
-
-
Method Details
-
getCql
Deprecated.Returns the CQL statement on which thePreparedStatementwill 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:PreparedStatementCreatorCreate a statement in this session. Allows implementations to usePreparedStatement.- Specified by:
createPreparedStatementin interfacePreparedStatementCreator- Parameters:
session-CqlSessionto use to create statement.- Returns:
- a prepared statement.
- Throws:
com.datastax.oss.driver.api.core.DriverException- there is no need to catchDriverExceptionthat may be thrown in the implementation of this method. TheCqlTemplateclass will handle them.
-