I have a Java class that is using the datastax cassandra driver to write a pojo to a cassandra table. Everything works fine, until it comes to having to write a class object to the cassandra table. It throws this error:
Caused by: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [frozen< projKeySpace.smi > <-> code.generic.common.data.MyCustomSmiObject]
So I have tried a lot of different things to try and make the attribute "Frozen", but nothing works and I keep getting the same error. Here is an example of the class object.
@Table(keyspace="projkeyspace", name="summarytable")
public class DataGroupingObject implements Serializable {
@Column(name = "objid")
private String objId;
@Column(name = "timeofjob")
private Date timeOfJob;
@Column(name = "smiobjectinput")
@Frozen
//Have also tried:
//@Frozen("frozen<projKeySpace.smi>")
//@Frozen("frozen<smi>")
//@Frozen("frozen<MyCustomSmiObject>")
//And all other permutations I can think of...
private MyCustomSmiObject myCustomSmiObject; //The problem attribute
@Column(name = "column5")
private String dataForColumn5;
//Getters and setters....
}
So what am I overlooking? Digging into the datastax documentation didn't show much beyond this, http://docs.datastax.com/en/drivers/java/2.2/com/datastax/driver/mapping/annotations/Frozen.html , which I tried.
I also have tried having the MyCustomSmiObject be mapped to the frozen 'projkeyspace.smi' and that didn't work (of course I didn't think it would since there isn't actually a table in cassandra called smi, its just a type) but here is an example of it:
@Table(keyspace="projkeyspace", name="smi")
public class MyCustomSmiObject implements Serializable {
@Column(name = "idstring")
private String idString;
@Column(name = "valuenum")
private Double valueNum;
//Getters and Setters....
}
So like I said, I am at a loss. Any help would be greatly appreciated and thanks in advance!