@Retention(value=RUNTIME) @Target(value={FIELD,TYPE_USE,TYPE_PARAMETER}) @Documented public @interface RuntimeCodec
//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();
public abstract Class<?> cqlClass
public abstract String codecName
Copyright © 2012-2021. All Rights Reserved.