FROM - Java source classTO - CQL-compatible target classpublic class CodecSignature<FROM,TO> extends Object
//Compile time
@Column
@RuntimeCodec(cqlClass = String.class)
private MyBean bean;
//Runtime
final Cluster cluster = .... // Create Java driver cluster object
final Codec<MyBean, String> statefulCodec = new .... // Create your codec with initialization logic here
final CodecSignature<MyBean, String> codecSignature = new CodecSignature(MyBean.class, String.class);
ManagerFactory factory = ManagerFactoryBuilder
.builder(cluster)
...
.withRuntimeCodec(codecSignature, codec)
.build();
Copyright © 2012-2021. All Rights Reserved.