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 Details

    • SimplePreparedStatementCreator

      public SimplePreparedStatementCreator(String cql)
      Create a SimplePreparedStatementCreator given cql.
      Parameters:
      cql - must not be null.
    • SimplePreparedStatementCreator

      public SimplePreparedStatementCreator(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
      Create a SimplePreparedStatementCreator given cql.
      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 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.
    • getCql

      public String 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 interface CqlProvider
      Returns:
      the CQL string.