Example usage for org.springframework.data.cassandra.config CassandraSessionFactoryBean setKeyspaceName

List of usage examples for org.springframework.data.cassandra.config CassandraSessionFactoryBean setKeyspaceName

Introduction

In this page you can find the example usage for org.springframework.data.cassandra.config CassandraSessionFactoryBean setKeyspaceName.

Prototype

public void setKeyspaceName(@Nullable String keyspaceName) 

Source Link

Document

Sets the name of the Cassandra Keyspace to connect to.

Usage

From source file:com.poc.cassandra.CassandraConfig.java

@Bean
public CassandraSessionFactoryBean session() throws Exception {

    CassandraSessionFactoryBean session = new CassandraSessionFactoryBean();
    session.setCluster(cluster().getObject());
    session.setKeyspaceName(env.getProperty("cassandra.keyspace"));
    session.setConverter(converter());/*ww  w .  j a v  a 2 s .  c  o  m*/
    session.setSchemaAction(SchemaAction.NONE);

    return session;
}