public static enum Hibernate5Module.Feature extends Enum<Hibernate5Module.Feature>
Enum Constant and Description |
---|
FORCE_LAZY_LOADING
Whether lazy-loaded object should be forced to be loaded and then serialized
(true); or serialized as nulls (false).
|
REPLACE_PERSISTENT_COLLECTIONS
|
REQUIRE_EXPLICIT_LAZY_LOADING_MARKER
This feature determines how
PersistentCollection s properties
for which no annotation is found are handled with respect to
lazy-loading: if true, lazy-loading is only assumed if annotation
is used to indicate that; if false, lazy-loading is assumed to be
the default. |
SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS
If FORCE_LAZY_LOADING is false, this feature serializes uninitialized lazy loading proxies as
{"identifierName":"identifierValue"} rather than null . |
USE_TRANSIENT_ANNOTATION
Whether
Transient annotation should be checked or not;
if true, will consider @Transient to mean that property is to be ignored;
if false annotation will have no effect. |
WRAP_IDENTIFIER_IN_OBJECT
Feature that may be disables to unwrap the identifier
of the serialized entity, returning a value instead of
an object.
|
WRITE_MISSING_ENTITIES_AS_NULL
Using
FORCE_LAZY_LOADING may result in
`javax.persistence.EntityNotFoundException`. |
Modifier and Type | Method and Description |
---|---|
static int |
collectDefaults()
Method that calculates bit set (flags) of all features that
are enabled by default.
|
boolean |
enabledByDefault() |
boolean |
enabledIn(int flags) |
int |
getMask() |
static Hibernate5Module.Feature |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Hibernate5Module.Feature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Hibernate5Module.Feature FORCE_LAZY_LOADING
Default value is false.
public static final Hibernate5Module.Feature USE_TRANSIENT_ANNOTATION
Transient
annotation should be checked or not;
if true, will consider @Transient
to mean that property is to be ignored;
if false annotation will have no effect.
Default value is true.
public static final Hibernate5Module.Feature SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS
{"identifierName":"identifierValue"}
rather than null
.
Default value is false.
Note that the name of the identifier property can only be determined if
Mapping
is provided to the Hibernate5Module, or @Id
annotation is applied to a method rather than a field)public static final Hibernate5Module.Feature REQUIRE_EXPLICIT_LAZY_LOADING_MARKER
PersistentCollection
s properties
for which no annotation is found are handled with respect to
lazy-loading: if true, lazy-loading is only assumed if annotation
is used to indicate that; if false, lazy-loading is assumed to be
the default.
Note that FORCE_LAZY_LOADING
has priority over this Feature;
meaning that if it is defined as true, setting of this Feature has no
effect.
Default value is false, meaning that laziness is considered to be the default value.
public static final Hibernate5Module.Feature REPLACE_PERSISTENT_COLLECTIONS
org.hibernate.collection.spi.PersistentCollection
,
List
, Set
, Map
subclasses
during serialization as standard JDK List
,
Set
and Map
.
This is usually done to prevent issues with polymorphic handling, so
that type id is generated for standard containers and NOT for Hibernate
variants.
Default setting is false, so that no replacement occurs.
public static final Hibernate5Module.Feature WRITE_MISSING_ENTITIES_AS_NULL
FORCE_LAZY_LOADING
may result in
`javax.persistence.EntityNotFoundException`. This flag configures Jackson to
ignore the error and serialize a `null`.public static final Hibernate5Module.Feature WRAP_IDENTIFIER_IN_OBJECT
public static Hibernate5Module.Feature[] values()
for (Hibernate5Module.Feature c : Hibernate5Module.Feature.values()) System.out.println(c);
public static Hibernate5Module.Feature valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static int collectDefaults()
public boolean enabledIn(int flags)
public boolean enabledByDefault()
public int getMask()
Copyright © 2021 FasterXML. All rights reserved.