Module spring.data.cassandra
Class CachedPreparedStatementCreator
java.lang.Object
org.springframework.data.cassandra.core.cql.CachedPreparedStatementCreator
- All Implemented Interfaces:
PreparedStatementCreator
@Deprecated(forRemoval=true)
public class CachedPreparedStatementCreator
extends Object
implements PreparedStatementCreator
Deprecated, for removal: This API element is subject to removal in a future version.
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
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Create aPreparedStatementCreatorfrom the provided CQL. -
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.cql.PreparedStatementcreatePreparedStatement(com.datastax.oss.driver.api.core.CqlSession session) Deprecated, for removal: This API element is subject to removal in a future version.Create a statement in this session.getCql()Deprecated, for removal: This API element is subject to removal in a future version.Returns the CQL statement on which thePreparedStatementwill be based.
-
Field Details
-
log
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
CachedPreparedStatementCreator
Deprecated, for removal: This API element is subject to removal in a future version.Create aPreparedStatementCreatorfrom the provided CQL.- Parameters:
cql- must not be empty or null.
-
-
Method Details
-
getCql
Deprecated, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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.
-