Annotation Interface EncodeNullHandlingStrategy


@Documented @Inherited @Retention(RUNTIME) @Target({FIELD,TYPE}) public @interface EncodeNullHandlingStrategy
Use this annotation to specify the handling of null values prior to encoding to the database. This annotation is thought for convenience. You can use it at class level or at field level. If you use it at class level, you can override each field with a field level annotation. A global default value can be set via PojoCodecProvider.Builder.encodeNullHandlingStrategy(Strategy) If not set, default is EncodeNullHandlingStrategy.Strategy.CODEC (due to historical behaviour of PojoCodecProvider) You can e.g. make sure, that lists fields that are null are always encoded as empty lists, if desired. Right now, two strategies exist: For future improvements more strategies could be added, e.g. one strategy could be to register a default-value-generator at the field.