Enum Hibernate4Module.Feature

    • Enum Constant Detail

      • FORCE_LAZY_LOADING

        public static final Hibernate4Module.Feature FORCE_LAZY_LOADING
        Whether lazy-loaded object should be forced to be loaded and then serialized (true); or serialized as nulls (false).

        Default value is false.

      • USE_TRANSIENT_ANNOTATION

        public static final Hibernate4Module.Feature 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.

        Default value is true.

      • SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS

        public static final Hibernate4Module.Feature 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.

        Default value is false.

        Note that the name of the identifier property can only be determined if

        • the Mapping is provided to the Hibernate4Module, or
        • the persistence context that loaded the proxy has not yet been closed, or
        • the id property is mapped with property access (for instance because the @Id annotation is applied to a method rather than a field)
        Otherwise, the entity name will be used instead.
      • REQUIRE_EXPLICIT_LAZY_LOADING_MARKER

        public static final Hibernate4Module.Feature REQUIRE_EXPLICIT_LAZY_LOADING_MARKER
        This feature determines how PersistentCollections 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.

        Since:
        2.4
      • REPLACE_PERSISTENT_COLLECTIONS

        public static final Hibernate4Module.Feature REPLACE_PERSISTENT_COLLECTIONS
        Feature that may be enabled to force replacement 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.

        Since:
        2.8.2
      • WRITE_MISSING_ENTITIES_AS_NULL

        public static final Hibernate4Module.Feature WRITE_MISSING_ENTITIES_AS_NULL
        Using FORCE_LAZY_LOADING may result in `javax.persistence.EntityNotFoundException`. This flag configures Jackson to ignore the error and serialize a `null`.
        Since:
        2.10
      • WRAP_IDENTIFIER_IN_OBJECT

        public static final Hibernate4Module.Feature WRAP_IDENTIFIER_IN_OBJECT
        Feature that may be disables to unwrap the identifier of the serialized entity, returning a value instead of an object.
        Since:
        2.12
    • Method Detail

      • values

        public static Hibernate4Module.Feature[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Hibernate4Module.Feature c : Hibernate4Module.Feature.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Hibernate4Module.Feature valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • collectDefaults

        public static int collectDefaults()
        Method that calculates bit set (flags) of all features that are enabled by default.
      • enabledIn

        public boolean enabledIn​(int flags)
      • enabledByDefault

        public boolean enabledByDefault()
      • getMask

        public int getMask()