otaviojava / easy-cassandra Goto Github PK
View Code? Open in Web Editor NEWeasy programming in Cassandra
Home Page: http://otaviojava.github.io/Easy-Cassandra/
License: Apache License 2.0
easy programming in Cassandra
Home Page: http://otaviojava.github.io/Easy-Cassandra/
License: Apache License 2.0
use javax.persistence.ElementCollection instead of collections annotations on Easy-Cassandra.
by: https://weblogs.java.net/blog/otaviojava/archive/2013/08/25/run-cassandra-spring-data#comment-829565
I keep getting the error :
com.datastax.driver.core.exceptions.InvalidQueryException: Unknown identifier id
when I try to run a similar example to yours. In my Apache Cassandra installtion, I have a keyspace afrikana, with two column families: users and roles. Both families do not have column metadata because my assumption is that the JPA annotated ORM will automatically create the columns on first run. Is that the case?
ORM sample
@XmlRootElement(name = "role")
@Entity(name="roles")
public class Role implements Serializable {
private static final long serialVersionUID = 9127322651789683331L;
@Id
@Column(name="id")
@XmlID
private String id;
@Index
@Column(name = "role_name")
@XmlElement(name = "role_name")
private String roleName;
//getters and setters
}
//The Java config files for cassandra
@Configuration
public class SpringDataConfig{
@Autowired
private Environment env;
@Bean
public CassandraFactoryAnnotation cassandraFactory(){
CassandraFactoryAnnotation factory = new CassandraFactoryAnnotation(
env.getRequiredProperty("cassandra.host"),
env.getRequiredProperty("cassandra.keySpace"));
List<Class<?>> columnFamilies = new ArrayList<Class<?>>();
columnFamilies.add(org.tutiworks.orm.User.class);
columnFamilies.add(org.tutiworks.orm.Role.class);
factory.setAnnotatedClasses(columnFamilies);
return factory;
}
@Bean
public SimpleCassandraTemplateImpl cassandraTemplate(){
SimpleCassandraTemplateImpl template = new SimpleCassandraTemplateImpl(cassandraFactory());
return template;
}
}
//The application config java config
@Configuration
@ComponentScan(basePackages = { "org.tutiworks","org.easycassandra.persistence.cassandra.spring" })
@EnableWebMvc
@Import({ SpringDataConfig.class, ThymeleafConfig.class })
@PropertySource("classpath:spring.properties")
public class ApplicationContext extends WebMvcConfigurerAdapter {
/code......
}
//repository
@Repository("roleRepository")
public class RoleRepository extends CassandraRepository<Role, String>{
@Autowired
private CassandraTemplate cassandraTemplate;
@Override
protected CassandraTemplate getCassandraTemplate() {
return cassandraTemplate;
}
}
//The controller class
@Controller
public class UserRoleController {
@Autowired
private RoleRepository roleRepository;
private static final Logger logger = Logger.getLogger(UserRoleController.class);
@RequestMapping("role/{id}")
@ResponseBody
public Role getById(@PathVariable Long id) {
UUID uuid=UUID.randomUUID();
String pkId = uuid.toString();
Role role = new Role();
role.setId(pkId);
role.setRoleName("ROLE_USER");
roleRepository.save(role);
return roleRepository.findOne(pkId);
}
@ExceptionHandler
@ResponseBody
public ResponseEntity<ErrorHolder> handle(ResourceNotFoundException e){
logger.warn("The resource was not found", e);
return new ResponseEntity<ErrorHolder>(new ErrorHolder("The resource was not found"), HttpStatus.NOT_FOUND);
}
class ErrorHolder {
public String errorMessage;
@JsonCreator
public ErrorHolder(@JsonProperty("errorMessage") String errorMessage){
this.errorMessage = errorMessage;
}
}
}
I keep getting the error:
com.datastax.driver.core.exceptions.InvalidQueryException: Unknown identifier id
thrown from the controller when I try to save the new role. What could be the problem??
Is it possible to map an enumeration using its name rather than its integer ordinal?
perform query asynchronously with callback
The constructor factory has a lot constructor methods, it's a bad practice use a dto with information of cluster instead it.
execute methods with range to key
Apologies if I've missed this in the docs but does EasyCassandra support compound keys?
http://www.datastax.com/documentation/cql/3.0/cql/ddl/ddl_compound_keys_c.html
Make a class to does complex queries on simple way using builders.
Hi there,
first thank you for the API. My issue is that I created two different keyspaces let say
KeySpace A and KeySpace B
and I defined TableA in KeySpaceA and TableB in KeySpaceB. and in DAO classes
I have an instance of org.easycassandra.persistence.Persistence
with
EasyCassandraManager.getPersistence(keySpace, IP, port);
But during testing I recognized that somehow TableB has been created in KeySpaceA and and vice versa.
My question is why Easy Cassandra created a new table in another keyspace and how can I force my entity to be persisted in a specific keyspace and not in anther.
I tried with
@table(name="countrytable", schema="countryspace") but it does not work.
thank you for your time and hesitation
Saeed
add improvemente update builder with key
Is there a way to work with temporary tables with EasyCassandra? As I understand it, the @entity annotation includes the table/CF name so, if I were to create a new table at runtime (with a unique name), is there a way to dynamically map an entity to it?
Hi there,
I don't see any way right now to pass the username/password credentials when connecting to the keyspace. Is this intentional? To support this, it seems like we would have to add a method that does something like this:
Cluster.Builder clusterBuilder = Cluster.builder()
.addContactPoints(hostnames).withPort(port)
.withCredentials(username, password);
Here is the Dao and the result:
@entity
public class Log implements Serializable {
private static final long serialVersionUID = 3L;
@id
private String uuid;
...
@Index
@column(name = "user_uuid")
private String user_uuid;
...
// get / set
...
}
Result
cqlsh:test_lp> DESCRIBE TABLE test_cassandra.Log;
CREATE TABLE Log (
KEY text PRIMARY KEY
) WITH
comment='' AND
comparator=text AND
read_repair_chance=0.100000 AND
gc_grace_seconds=864000 AND
default_validation=text AND
min_compaction_threshold=4 AND
max_compaction_threshold=32 AND
replicate_on_write='true' AND
compaction_strategy_class='SizeTieredCompactionStrategy' AND
compression_parameters:sstable_compression='SnappyCompressor';
When using hibernate-validator, an exception is thrown at initialization. The cause is missing null check located at javax.persistence.Persistence$PersistenceUtilImpl.isLoaded(Persistence.java:190).
The bug has been fixed in 1.0.13.
Hello,
I tried your solution of embeddedId but i still get errors :(
table declaration:
CREATE COLUMNFAMILY medimage.tag (
id_dicom uuid,
nom text,
codifie boolean,
PRIMARY KEY (id_dicom, nom)
);
those are my classes:
public class IdTag{
@column
private UUID id_dicom;
@column
private String nom;
public IdTag() {
super();
// TODO Auto-generated constructor stub
}
public IdTag(UUID id_dicom, String nom) {
super();
this.id_dicom = id_dicom;
this.nom = nom;
}
public UUID getId_dicom() {
return id_dicom;
}
public void setId_dicom(UUID id_dicom) {
this.id_dicom = id_dicom;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
}
@entity(name = "tag")
public class Tag implements Serializable{
private static final long serialVersionUID = 3L;
@EmbeddedId
private IdTag id;
@column
private Boolean codifie;
public Tag (UUID id_dicom, String nom, Boolean codifie){
this.id = new IdTag(id_dicom, nom);
this.codifie = codifie;
}
public Tag(IdTag id, Boolean codifie) {
super();
this.id = id;
this.codifie = codifie;
}
public IdTag getId() {
return id;
}
public void setId(IdTag id) {
this.id = id;
}
public Boolean getCodifie() {
return codifie;
}
public void setCodifie(Boolean codifie) {
this.codifie = codifie;
}
}
public class TagRepository {
private Persistence persistence;
public List find(String nom) {
return persistence.selectBuilder(Tag.class).eq("nom", nom).execute();
}
{
this.persistence = CassandraManager.INSTANCE.getPersistence();
}
public void save(Tag tag) {
persistence.insert(tag);
}
public Tag findByDicomId(UUID uuid) {
return persistence.findByKey(uuid, Tag.class);
}
public List findAll(){
return persistence.findAll(Tag.class);
}
}
When I try to fetch elements by name ("nom") or simply all elements i get a arraylist with the right amount of elements but all null.
Could you help me?
Stacktraces:
sept. 24, 2014 3:20:23 PM org.easycassandra.util.ReflectionUtil newInstance
Grave: null
java.lang.InstantiationException: cnam.medimage.bean.Tag
at java.lang.Class.newInstance(Class.java:359)
at org.easycassandra.util.ReflectionUtil.newInstance(ReflectionUtil.java:73)
at org.easycassandra.persistence.cassandra.RecoveryObject.createObject(RecoveryObject.java:56)
at org.easycassandra.persistence.cassandra.RecoveryObject.recoverObjet(RecoveryObject.java:47)
at org.easycassandra.persistence.cassandra.SelectBuilderImpl.execute(SelectBuilderImpl.java:157)
at cnam.medimage.repository.TagRepository.find(TagRepository.java:20)
at cnam.medimage.controller.AideController.handleRequest(AideController.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:724)
sept. 24, 2014 3:20:23 PM org.easycassandra.util.ReflectionUtil setMethod
Grave: null
java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:54)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:75)
at java.lang.reflect.Field.set(Field.java:741)
at org.easycassandra.util.ReflectionUtil.setMethod(ReflectionUtil.java:57)
at org.easycassandra.persistence.cassandra.RecoveryObject.createObject(RecoveryObject.java:61)
at org.easycassandra.persistence.cassandra.RecoveryObject.recoverObjet(RecoveryObject.java:47)
at org.easycassandra.persistence.cassandra.SelectBuilderImpl.execute(SelectBuilderImpl.java:157)
at cnam.medimage.repository.TagRepository.find(TagRepository.java:20)
at cnam.medimage.controller.AideController.handleRequest(AideController.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:724)
sept. 24, 2014 3:20:23 PM org.easycassandra.util.ReflectionUtil setMethod
Grave: null
java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:54)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:75)
at java.lang.reflect.Field.set(Field.java:741)
at org.easycassandra.util.ReflectionUtil.setMethod(ReflectionUtil.java:57)
at org.easycassandra.persistence.cassandra.RecoveryObject.createObject(RecoveryObject.java:66)
at org.easycassandra.persistence.cassandra.RecoveryObject.recoverObjet(RecoveryObject.java:47)
at org.easycassandra.persistence.cassandra.SelectBuilderImpl.execute(SelectBuilderImpl.java:157)
at cnam.medimage.repository.TagRepository.find(TagRepository.java:20)
at cnam.medimage.controller.AideController.handleRequest(AideController.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:724)
The method ColumnUtil.getFieldByColumnName
cannot find a declared index if the field and the column have different names.
For example, if a field is declared this way:
@Index
@Column(name = "value")
private String fValue;
then the column and the index are created with name value
.
But calling ColumnUtil.getFieldByColumnName
with value
throws an exception.
The line ColumnUtil:388
has to be changed from:
if(index.getName().equals(columnName)){
to:
if(getColumnName(index).equals(columnName)){
so the behavior is correct.
Is there a support to allow multiple classes to be mapped to a single table via a discriminator column?
For example:
@entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.INTEGER)
public abstract Superclass
Then you can have multiple subclasses of one superclass mapped
@entity
@DiscriminatorValue("3")
public Subclass1 extends SuperClass
@entity
@DiscriminatorValue("2")
public Subclass2 extends SuperClass
Does EasyCassandra support Cassandra 2.0's automatic paging model?http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0
If not, what's the recommended way to handle large result sets?
On processo with one hundred thousand cassandra spend about 2 percent of all process.
Refactor name and methods on AsyncCallBack
Are there plans to upload the EC JARs to maven central?
I'm working on an OSGi project which uses gradle to build bundles, requiring me to add the custom EC maven repo into each script. For now, I put the JAR in our own internal maven repo but it would be neater if they were in maven central IMHO.
Hi, I'm trying to integrate Easy-cassandra into my app, which uses Spring with its AnnotationConfigApplicationContext.
I was able to instantiate CassandraFactoryAnnotation like this:
@Bean
public CassandraFactoryAnnotation cassandraFactoryAnnotation(){
CassandraFactoryAnnotation cfa = new CassandraFactoryAnnotation(cassandraClusterInformation());
List<Class<?>> annotatedClasses = new LinkedList<Class<?>>();
annotatedClasses.add(TtfDocument.class);
cfa.setAnnotatedClasses(annotatedClasses);
return cfa;
}
public ClusterInformation cassandraClusterInformation()
{
ClusterInformation ci = new ClusterInformation();
ci.setKeySpace("traveladvisor");
ci.addHost("localhost");
return ci;
}
The code seems to work, but my application doesn't want to quit, even when there's no usage of cassandra. When the CassandraFactoryAnnotation bean gets instantialised, the app doesn't want to stop.
It looks like the Cassandra Java Driver worker threads don't stop.
Any ideas why? Have I done something wrong? I am using the Spring 4.0.0.RELEASE version.
Thanks.
Hi
Could you support cassandra-diver-core 2.0.0?
If I use the version of cassandra driver core, "Caused by: java.lang.ClassNotFoundException: com.datastax.driver.core.Query" exception is occured.
I hope to support this~
I have an entity with the following member:
@ElementCollection
@column(name="fields")
private Map<String, String> fields;
I can persist the entity to Cassandra ok but, when I query it (using findOne) I can read the map keys/values but if I try adding another key-value, I see the following exception:
Exception in thread "main" java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableMap.put(Collections.java:1342)
It seems that EasyCassandra is giving me an immutable object back. Is this correct?
What's the suggested approach for reading a record with a collection, updating the collection, and writing back to the DB?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.