This is an example how to save JSON to a MySQL database (version > 5.7) using Hibernate.
For this, a custom Hibernate UserType needs to be implemented. In order to serialize a Java object to JSON (or to deserialize JSON to a Java object) Jackson library is used. In order to be able to save more than only one type of JSON, the custom UserType also implements Hibernate's ParameterizedType. This allows to specify the type using Hibernate's Parameter annotation.
Integrations are performed using Maven Failsafe Plugin. Docker maven plugin allows to build Docker images and, hence, perform the integration test on a real database.