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
-
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 interfaceorg.springframework.beans.factory.FactoryBean<CqlTemplate>
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<CqlTemplate>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<CqlTemplate>
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- 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:
-