Class CassandraTemplateFactoryBean
java.lang.Object
org.springframework.data.cassandra.config.CassandraTemplateFactoryBean
- All Implemented Interfaces:
FactoryBean<CassandraTemplate>,InitializingBean
public class CassandraTemplateFactoryBean
extends Object
implements FactoryBean<CassandraTemplate>, InitializingBean
Factory for configuring a
CassandraTemplate.- Author:
- Matthew T. Adams, Mark Paluch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CassandraConverterprotected CqlOperationsprotected SessionFactoryFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidsetConverter(CassandraConverter converter) Set theCassandraConverterto use.voidsetCqlOperations(CqlOperations cqlOperations) Sets the CassandraCqlOperationsto use.voidsetSession(com.datastax.oss.driver.api.core.CqlSession session) Sets the CassandraCqlSessionto use.voidsetSessionFactory(SessionFactory sessionFactory) Sets the CassandraSessionFactoryto use.
-
Field Details
-
sessionFactory
-
cqlOperations
-
converter
-
-
Constructor Details
-
CassandraTemplateFactoryBean
public CassandraTemplateFactoryBean()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-
getObject
- Specified by:
getObjectin interfaceFactoryBean<CassandraTemplate>- Throws:
Exception
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<CassandraTemplate>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceFactoryBean<CassandraTemplate>
-
setSession
public void setSession(com.datastax.oss.driver.api.core.CqlSession session) Sets the CassandraCqlSessionto use. TheCassandraTemplatewill use the logged keyspace of the underlyingCqlSession. Don't change the keyspace using CQL but use aSessionFactory.- Parameters:
session- must not be null.
-
setSessionFactory
Sets the CassandraSessionFactoryto use. TheCassandraTemplatewill use the logged keyspace of the underlyingCqlSession. Don't change the keyspace using CQL.- Parameters:
sessionFactory- must not be null.- Since:
- 2.0
-
setCqlOperations
Sets the CassandraCqlOperationsto use. TheCassandraTemplatewill use the logged keyspace of the underlyingCqlSession. Don't change the keyspace using CQL but usesetSessionFactory(SessionFactory).- Parameters:
cqlOperations- must not be null.- Since:
- 2.0
-
setConverter
Set theCassandraConverterto use.- Parameters:
converter- must not be null.
-