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

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

Introduction

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

Prototype

public void setCluster(Cluster cluster) 

Source Link

Document

Sets a reference to the Cassandra Cluster to use.

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());/*  w  ww  .ja  v  a 2s . c  o m*/
    session.setSchemaAction(SchemaAction.NONE);

    return session;
}