I defined a custom objectMapper with ```@Bean @Pri...
# jackson-kotlin
p
I defined a custom objectMapper with
Copy code
@Bean
@Primary
fun objectMapper(): ObjectMapper = ...
but this objectMapper is not used when persisting an Entity. The entity has a json field, where my custom serializer would be needed. But based on the error message it seems, that hibernate is not using that serializer. How to tell hibernate to use my custom objectMapper for json fields?
p
TL;DR In hibernate 6, this solved
Copy code
@Bean
fun jsonFormatMapper(objectMapper: ObjectMapper): HibernatePropertiesCustomizer =
    HibernatePropertiesCustomizer {
        it[AvailableSettings.JSON_FORMAT_MAPPER] = JacksonJsonFormatMapper(objectMapper)
    }