Skip to content

Instantly share code, notes, and snippets.

@AnarCom
Created September 13, 2023 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnarCom/87bc5322bdd4e754d313bd93ce14c68b to your computer and use it in GitHub Desktop.
Save AnarCom/87bc5322bdd4e754d313bd93ce14c68b to your computer and use it in GitHub Desktop.
Hibernate + jackson + json problem (no default constructor)
@Configuration
class HibernatePropertiesChanger(
val objectMapper: ObjectMapper
) {
@Bean
fun hibernatesPropertiesCustomizer(): HibernatePropertiesCustomizer {
return HibernatePropertiesCustomizer {
it[AvailableSettings.JSON_FORMAT_MAPPER] = JacksonJsonFormatMapper(objectMapper)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment