FAQ Database Discussion Community


Autogenerate UUID or timeuuid in spring-data Cassandra?

java,cassandra,spring-data,uuid,spring-data-cassandra
I am using spring-data-cassandra. Is there a way or an annotation, which can be used in my entity java POJO for the primary key of type uuid or timeuuid,to auto-generate the value of the primary key(id)? I know that I can use id = UUIDs.timeBased();, but I want to automate...

Implementation of hashCode in PrimaryKeyClass of spring-data-cassandra

java,spring,cassandra,spring-data,spring-data-cassandra
I am using spring-data-cassandra and have a table such that its primary key is ((int_col1,int_col2),bigint_col1,bigint_col2). int_col1&int_col2 are the partition keys bigint_col1 & bigint_col2 are the cluster keys. How important is it to implement hashcode & equals method for my class. What should be the hashcode implementation of my above @PrimaryKeyClass...

Spring boot cassandra integration @EnableCassandraRepositories not generating implementation for Cassandra Repository

spring-boot,spring-data-cassandra
I am trying to integrate cassandra with Spring boot using spring-data-cassandra. Application.java package hello; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.context.annotation.ComponentScan; @ComponentScan @EnableAutoConfiguration public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } CassandraConfiguration.java package conf; import...

spring-cassandra UDT data insert

java,annotations,cassandra,datastax-java-driver,spring-data-cassandra
Can someone help me to find out how to insert Cassandra UDT data using Spring POJO class? I created one POJO class to map Cassandra's Table and Created one another class for Cassandra UDT, but when i inserted main POJO class that map Cassandra's table than it's not recognized another...

spring-data-cassandra component/complex type denormalized mapping

spring-data-cassandra
I'm trying to use spring-data-cassandra (1.1.2.RELEASE) and I'm running into an issue with the lack of embeddable type mapping in JPA parlance. I have an entity class like this: @Table public class Customer { private UUID id; private String name; private Address address; public UUID getId() { return id; }...

Spring-Cassandra Unit with Embedded Cassandra Dependency Injection Issue

unit-testing,cassandra,cassandra-2.0,spring-data-cassandra
I am having issue with Spring unit testing with Embedded Cassandra. The issue is both Embedded Cassandra and My Cassandra Server are starting at the same time. How to make sure that during unit testing only Embedded Cassandra Starts. I am using spring-data for Cassandra. I have the following Spring...