Our great sponsors
-
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.
-
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.
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.