spring-data-cassandra

Spring Boot with Cassandra 3.x driver

末鹿安然 提交于 2019-12-10 10:34:36
问题 I use Spring boot 1.3.8.RELEASE . To use cassandra 3.x driver i tried something like below; <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-cassandra</artifactId> <exclusions> <exclusion> <groupId>org.springframework.data</groupId> <artifactId>spring-data-cassandra</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-cassandra</artifactId> <version>1.4.0.RELEASE<

Spring-data-cassandra 1.3.4 not compatible with Cassandra 3.x

此生再无相见时 提交于 2019-12-09 17:58:55
问题 I have tried using Spring-data-cassandra 1.3.4 along with the latest cassandra-driver-core : 3.0.0 On Cassandra 2.1.12 (which comes as part of DSE 4.8.4) and everything works fine. Where as same spring batch doesn't work with the plain Cassandra 3.x versions. I tried it out on Cassandra 3.2,3.3 & 3.4. I get the ClassNotFound Exception which is mentioned in the below stack trace. Now I totally understand that this is due to a particular method(asJavaClass) not being present in "com.datastax

Querying Tables with Composite Primary Keys using Spring-data-cassandra

浪子不回头ぞ 提交于 2019-12-07 06:05:40
问题 I'm getting the following exception when using the findOne() or findAll() method of CassandraReporitory: Caused by: java.lang.IllegalStateException: property does not have a single column mapping at org.springframework.data.cassandra.mapping.BasicCassandraPersistentProperty.getColumnName(BasicCassandraPersistentProperty.java:134) at org.springframework.data.cassandra.convert.BasicCassandraRowValueProvider.getPropertyValue(BasicCassandraRowValueProvider.java:64) at org.springframework.data

How to initialize Cassandra keyspace and tables with Spring boot

≡放荡痞女 提交于 2019-12-07 04:05:12
问题 I am using Cassandra as a datasource in my Spring boot application and would like to initialize the database before the application starts. Up to now what I have done is, I have defined a class "CassandraConfiguration" extending "AbstractCassandraConfiguration" class as in the examples which you can see below and I have a repository extending "CassandraRepository". When I create the keyspace and the table myself, the application works fine. However, I want to create the keyspace and tables

Querying Tables with Composite Primary Keys using Spring-data-cassandra

删除回忆录丶 提交于 2019-12-05 09:52:18
I'm getting the following exception when using the findOne() or findAll() method of CassandraReporitory: Caused by: java.lang.IllegalStateException: property does not have a single column mapping at org.springframework.data.cassandra.mapping.BasicCassandraPersistentProperty.getColumnName(BasicCassandraPersistentProperty.java:134) at org.springframework.data.cassandra.convert.BasicCassandraRowValueProvider.getPropertyValue(BasicCassandraRowValueProvider.java:64) at org.springframework.data.cassandra.convert.BasicCassandraRowValueProvider.getPropertyValue(BasicCassandraRowValueProvider.java:35)

How to initialize Cassandra keyspace and tables with Spring boot

断了今生、忘了曾经 提交于 2019-12-05 06:10:37
I am using Cassandra as a datasource in my Spring boot application and would like to initialize the database before the application starts. Up to now what I have done is, I have defined a class "CassandraConfiguration" extending "AbstractCassandraConfiguration" class as in the examples which you can see below and I have a repository extending "CassandraRepository". When I create the keyspace and the table myself, the application works fine. However, I want to create the keyspace and tables automatically while application is starting. In order to do that, I supplied a schema.cql file under

Spring-Data-Cassandra causes XSD validation error using XML configuration

泪湿孤枕 提交于 2019-12-04 19:37:37
Heyy hello, I have some kind of error that won't affect on my project's compilation,deployment and running But it shows red mark at my configuration file for Spring-data-Cassandra also shows problem in problems menu. Can any one please tell what's the issue? I have seen same question related to spring-data-JPA and Spring-data-* but they are not helping so I am posting this one. here is error message:- The errors below were detected when validating the file "spring-tool.xsd" via the file "application-config.xml". In most cases these errors can be detected by validating "spring-tool.xsd"

Using Spring Batch to write to a Cassandra Database

北城余情 提交于 2019-12-04 12:06:48
As of now, I'm able to connect to Cassandra via the following code: import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Session; public static Session connection() { Cluster cluster = Cluster.builder() .addContactPoints("IP1", "IP2") .withCredentials("user", "password") .withSSL() .build(); Session session = null; try { session = cluster.connect("database_name"); session.execute("CQL Statement"); } finally { IOUtils.closeQuietly(session); IOUtils.closeQuietly(cluster); } return session; } The problem is that I need to write to Cassandra in a Spring Batch project. Most of

Spring-data-cassandra 1.3.4 not compatible with Cassandra 3.x

不想你离开。 提交于 2019-12-04 06:14:42
I have tried using Spring-data-cassandra 1.3.4 along with the latest cassandra-driver-core : 3.0.0 On Cassandra 2.1.12 (which comes as part of DSE 4.8.4) and everything works fine. Where as same spring batch doesn't work with the plain Cassandra 3.x versions. I tried it out on Cassandra 3.2,3.3 & 3.4. I get the ClassNotFound Exception which is mentioned in the below stack trace. Now I totally understand that this is due to a particular method(asJavaClass) not being present in "com.datastax.driver.core.DataType.java". My question is is there any alternative way to get around this? I am using

Multiple keyspace support for spring-data-cassandra repositories?

独自空忆成欢 提交于 2019-12-03 04:02:43
Does Spring Data Cassandra support multiple keyspace repositories in the same application context? I am setting up the cassandra spring data configuration using the following JavaConfig class @Configuration @EnableCassandraRepositories(basePackages = "com.blah.repository") public class CassandraConfig extends AbstractCassandraConfiguration { @Override public String getKeyspaceName() { return "keyspace1"; } I tried creating a second configuration class after moving the repository classes to a different package. @Configuration @EnableCassandraRepositories(basePackages = "com.blah