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
    Modifier and Type
    Field
    Description
    protected final Log
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a PreparedStatementCreator from the provided CQL.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.datastax.oss.driver.api.core.cql.PreparedStatement
    createPreparedStatement(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.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the CQL statement on which the PreparedStatement will be based.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      protected final Log log
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • CachedPreparedStatementCreator

      public CachedPreparedStatementCreator(String cql)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a PreparedStatementCreator from the provided CQL.
      Parameters:
      cql - must not be empty or null.
  • Method Details

    • getCql

      public String getCql()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the CQL statement on which the PreparedStatement 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, for removal: This API element is subject to removal in a future version.
      Description copied from interface: PreparedStatementCreator
      Create a statement in this session. Allows implementations to use PreparedStatement.
      Specified by:
      createPreparedStatement in interface PreparedStatementCreator
      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 catch DriverException that may be thrown in the implementation of this method. The CqlTemplate class will handle them.