I am a Cassandra newbie and I am encountering an issue regarding the object-mapping API.
I have a mapped class like this:
@Table(keyspace = "analytics", name = "events")
public class CassandraEventRecord {
@PartitionKey
private String id;
private String name;
private Date startTime;
private Date endTime;
private Map<String, Object> parameters;
public CassandraEventRecord() {
}
public CassandraEventRecord(EventRecord record) {
this.id = record.getId();
this.name = record.getName();
this.startTime = record.getStartTime();
this.endTime = record.getEndTime();
this.parameters = record.getParameters();
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the startTime
*/
public Date getStartTime() {
return startTime;
}
/**
* @param startTime the startTime to set
*/
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
/**
* @return the endTime
*/
public Date getEndTime() {
return endTime;
}
/**
* @param endTime the endTime to set
*/
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
/**
* @return the parameters
*/
public Map<String, Object> getParameters() {
return parameters;
}
/**
* @param parameters the parameters to set
*/
public void setParameters(Map<String, Object> parameters) {
this.parameters = parameters;
}
Cassandra is running embedded in OSGi. I am using Java 7 on Windows 8.1.
Mapper<CassandraEventRecord> mapper = manager.mapper(CassandraEventRecord.class);
CassandraEventRecord cassandraEventRecord = new CassandraEventRecord(eventRecord);
mapper.saveAsync(cassandraEventRecord);
Record is not saved and there is no exception. After investigating further, my code is stuck at the line that mapper is retrieved as statements after manager.mapper(...) is never executed.
Insert queries built with QueryBuilder are working but not mapping. What is wrong? Do you have any idea?
Edit: Here's the stack trace