Class CassandraTemplateFactoryBean

java.lang.Object
org.springframework.data.cassandra.config.CassandraTemplateFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<CassandraTemplate>, org.springframework.beans.factory.InitializingBean

public class CassandraTemplateFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<CassandraTemplate>, org.springframework.beans.factory.InitializingBean
Factory for configuring a CassandraTemplate.
Author:
Matthew T. Adams, Mark Paluch
  • Field Details

  • Constructor Details

    • CassandraTemplateFactoryBean

      public CassandraTemplateFactoryBean()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • getObject

      public CassandraTemplate getObject() throws Exception
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<CassandraTemplate>
      Throws:
      Exception
    • getObjectType

      public Class<CassandraTemplate> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<CassandraTemplate>
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean<CassandraTemplate>
    • setSession

      public void setSession(com.datastax.oss.driver.api.core.CqlSession session)
      Sets the Cassandra CqlSession to use. The CassandraTemplate will use the logged keyspace of the underlying CqlSession. Don't change the keyspace using CQL but use a SessionFactory.
      Parameters:
      session - must not be null.
    • setSessionFactory

      public void setSessionFactory(SessionFactory sessionFactory)
      Sets the Cassandra SessionFactory to use. The CassandraTemplate will use the logged keyspace of the underlying CqlSession. Don't change the keyspace using CQL.
      Parameters:
      sessionFactory - must not be null.
      Since:
      2.0
    • setCqlOperations

      public void setCqlOperations(CqlOperations cqlOperations)
      Sets the Cassandra CqlOperations to use. The CassandraTemplate will use the logged keyspace of the underlying CqlSession. Don't change the keyspace using CQL but use setSessionFactory(SessionFactory).
      Parameters:
      cqlOperations - must not be null.
      Since:
      2.0
    • setConverter

      public void setConverter(CassandraConverter converter)
      Set the CassandraConverter to use.
      Parameters:
      converter - must not be null.