Class Jackson3JsonFormatMapper
java.lang.Object
org.hibernate.type.format.AbstractJsonFormatMapper
org.tailormap.api.configuration.Jackson3JsonFormatMapper
- All Implemented Interfaces:
org.hibernate.type.format.FormatMapper
public class Jackson3JsonFormatMapper
extends org.hibernate.type.format.AbstractJsonFormatMapper
Custom JSON format mapper for Hibernate that uses the Jackson 3 library for JSON serialization and deserialization.
This format mapper allows Hibernate to handle JSON types using Jackson, which is the primary JSON processing library
used in the application. By implementing this custom format mapper, we ensure that Hibernate can correctly serialize
and deserialize JSON properties in a way that is compatible with the application's JSON processing needs, especially
since Hibernate 7.2.x does not natively support Jackson 3. See
HibernateConfiguration for how this format
mapper is registered with Hibernate and:
for more context on the need for a custom JSON format mapper with Hibernate 7.2.x and Jackson 3. This class should be
removed after Hibernate 7.3.x or higher is released/implemented in TM.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TfromString(CharSequence charSequence, Type type) <T> TreadFromSource(org.hibernate.type.descriptor.java.JavaType<T> javaType, Object source, org.hibernate.type.descriptor.WrapperOptions options) booleansupportsSourceType(Class<?> sourceType) booleansupportsTargetType(Class<?> targetType) <T> String<T> voidwriteToTarget(T value, org.hibernate.type.descriptor.java.JavaType<T> javaType, Object target, org.hibernate.type.descriptor.WrapperOptions options) Methods inherited from class org.hibernate.type.format.AbstractJsonFormatMapper
fromString, toString
-
Field Details
-
SHORT_NAME
- See Also:
-
-
Constructor Details
-
Jackson3JsonFormatMapper
public Jackson3JsonFormatMapper() -
Jackson3JsonFormatMapper
public Jackson3JsonFormatMapper(tools.jackson.databind.json.JsonMapper jsonMapper)
-
-
Method Details
-
writeToTarget
public <T> void writeToTarget(T value, org.hibernate.type.descriptor.java.JavaType<T> javaType, Object target, org.hibernate.type.descriptor.WrapperOptions options) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
readFromSource
public <T> T readFromSource(org.hibernate.type.descriptor.java.JavaType<T> javaType, Object source, org.hibernate.type.descriptor.WrapperOptions options) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
supportsSourceType
-
supportsTargetType
-
fromString
- Specified by:
fromStringin classorg.hibernate.type.format.AbstractJsonFormatMapper
-
toString
-