Class CassandraCqlTemplateFactoryBean

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

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

    • CassandraCqlTemplateFactoryBean

      public CassandraCqlTemplateFactoryBean()
  • Method Details

    • getObject

      public CqlTemplate getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<CqlTemplate>
    • getObjectType

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

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

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

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

      public void setSessionFactory(SessionFactory sessionFactory)
      Sets the Cassandra SessionFactory to use. The CqlTemplate will use the logged keyspace of the underlying SessionFactory. Don't change the keyspace using CQL but use an appropriate SessionFactory.
      Parameters:
      sessionFactory - must not be null.
      See Also: