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 Details

  • 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

      public boolean supportsSourceType(Class<?> sourceType)
    • supportsTargetType

      public boolean supportsTargetType(Class<?> targetType)
    • fromString

      public <T> T fromString(CharSequence charSequence, Type type)
      Specified by:
      fromString in class org.hibernate.type.format.AbstractJsonFormatMapper
    • toString

      public <T> String toString(T value, Type type)
      Specified by:
      toString in class org.hibernate.type.format.AbstractJsonFormatMapper