Class CassandraCqlTemplateFactoryBean
java.lang.Object
org.springframework.data.cassandra.config.CassandraCqlTemplateFactoryBean
- All Implemented Interfaces:
FactoryBean<CqlTemplate>
,InitializingBean
public class CassandraCqlTemplateFactoryBean
extends Object
implements FactoryBean<CqlTemplate>, InitializingBean
Factory for configuring a
CqlTemplate
.- Author:
- Matthew T. Adams, Mark Paluch
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
void
setSession
(com.datastax.oss.driver.api.core.CqlSession session) Sets the CassandraCqlSession
to use.void
setSessionFactory
(SessionFactory sessionFactory) Sets the CassandraSessionFactory
to use.
-
Constructor Details
-
CassandraCqlTemplateFactoryBean
public CassandraCqlTemplateFactoryBean()
-
-
Method Details
-
getObject
- Specified by:
getObject
in interfaceFactoryBean<CqlTemplate>
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<CqlTemplate>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceFactoryBean<CqlTemplate>
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
setSession
public void setSession(com.datastax.oss.driver.api.core.CqlSession session) Sets the CassandraCqlSession
to use. TheCqlTemplate
will use the logged keyspace of the underlyingCqlSession
. Don't change the keyspace using CQL but use multipleCqlSession
andCqlTemplate
beans.- Parameters:
session
- must not be null.
-
setSessionFactory
Sets the CassandraSessionFactory
to use. TheCqlTemplate
will use the logged keyspace of the underlyingSessionFactory
. Don't change the keyspace using CQL but use an appropriateSessionFactory
.- Parameters:
sessionFactory
- must not be null.- See Also:
-