use of org.springframework.data.cassandra.config.SessionFactoryFactoryBean in project spring-data-cassandra by spring-projects.
the class CassandraConfig method sessionFactory.
@Bean
public SessionFactoryFactoryBean sessionFactory(CqlSession session, CassandraConverter converter) {
SessionFactoryFactoryBean sessionFactory = new SessionFactoryFactoryBean();
sessionFactory.setSession(session);
sessionFactory.setConverter(converter);
sessionFactory.setSchemaAction(SchemaAction.NONE);
return sessionFactory;
}
use of org.springframework.data.cassandra.config.SessionFactoryFactoryBean in project spring-boot by spring-projects.
the class CassandraDataAutoConfiguration method cassandraSessionFactory.
@Bean
@ConditionalOnMissingBean(SessionFactory.class)
public SessionFactoryFactoryBean cassandraSessionFactory(Environment environment, CassandraConverter converter) {
SessionFactoryFactoryBean session = new SessionFactoryFactoryBean();
session.setSession(this.session);
session.setConverter(converter);
Binder binder = Binder.get(environment);
binder.bind("spring.data.cassandra.schema-action", SchemaAction.class).ifBound(session::setSchemaAction);
return session;
}
Aggregations