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
Modifier and TypeFieldDescriptionprotected CassandraConverter
protected CqlOperations
protected SessionFactory
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
void
setConverter
(CassandraConverter converter) Set theCassandraConverter
to use.void
setCqlOperations
(CqlOperations cqlOperations) Sets the CassandraCqlOperations
to use.void
setSession
(com.datastax.oss.driver.api.core.CqlSession session) Sets the CassandraCqlSession
to use.void
setSessionFactory
(SessionFactory sessionFactory) Sets the CassandraSessionFactory
to use.
-
Field Details
-
sessionFactory
-
cqlOperations
-
converter
-
-
Constructor Details
-
CassandraTemplateFactoryBean
public CassandraTemplateFactoryBean()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
getObject
- Specified by:
getObject
in interfaceFactoryBean<CassandraTemplate>
- Throws:
Exception
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<CassandraTemplate>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceFactoryBean<CassandraTemplate>
-
setSession
public void setSession(com.datastax.oss.driver.api.core.CqlSession session) Sets the CassandraCqlSession
to use. TheCassandraTemplate
will 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 CassandraSessionFactory
to use. TheCassandraTemplate
will 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 CassandraCqlOperations
to use. TheCassandraTemplate
will 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 theCassandraConverter
to use.- Parameters:
converter
- must not be null.
-