The best way to map JSON with JPA and Hibernate

This page summarizes the projects mentioned and recommended in the original post on /r/java

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • hypersistence-utils

    The Hypersistence Utils library (previously known as Hibernate Types) gives you Spring and Hibernate utilities that can help you get the most out of your data access layer.

  • Now, related to your question. The entity field type has to be saved to a column type that JDBC has support for because you need to call the proper setXXX method on the JDBC PreparedStatement. In your case, which one of the standard PreparedStatement binding methods would you call to save that Map? That's a problem the Hibernate Types solves for you, and you can have whatever you want at the entity level: Map, JsonNode, POJO, List, String. And, the generic JsonType I created works for Oracle, PostgreSQL, MySQL, SQL Server, and H2 without any code change.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts