What is the best practice for working with JSON column within Java code? Specifically I am interested in being able to save & query JSON columns in a MySQL DB using hibernate..
@Entity
public class MyEntity {
private String myField; // this field is a json column
public MyEntity() {
}
}
There is a good library to deal with JSON types in Hibernate. It's called Hibernate Types, and you can scroll down to the MySQL section to get the right example.
And some samples of usage MySQL's JSON API inside query:
How to search JSON data in MySQL?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With