de.bild.codec.annotations.EncodeNulls Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polymorphia Show documentation
Show all versions of polymorphia Show documentation
A very fast POJO codec for MongoDB (used in conjunction with the Mongo Java Driver) that handles generic types as well as polymorphic class hierarchies
package de.bild.codec.annotations;
import java.lang.annotation.*;
/**
* If you need nulls to be written out to the database, use this annotation either at pojo class level or at field level.
* Please note: If you set EncodeNulls=false and decode entities with undefined values within the mongo database,
* the {@link DecodeUndefinedHandlingStrategy} will influence the decoded value
*
* Global behaviour can be set during registration of {@link de.bild.codec.PojoCodecProvider.Builder#encodeNulls(boolean)}
*
*/
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface EncodeNulls {
boolean value() default true;
}