I am using MySQL and jpa/hibernate.
So I want column as Json datatype in JPA, but its not supporting.
Also therefore I am not able to use in criterion query.
Which is appropriate ways to handle this?
Asked
Active
Viewed 256 times
0

Vikrant
- 4,920
- 17
- 48
- 72
-
Maybe this helps: https://stackoverflow.com/questions/25738569/how-to-map-a-map-json-column-to-java-object-with-jpa – Christophe Roussy Oct 03 '19 at 09:30
1 Answers
0
This is something that worked for me
@Entity
@Table
@TypeDef(
name = "jsonb",
typeClass = JsonBinaryType.class
)
public class Blah{
//add your fields
@Type(type = "jsonb")
@Column(columnDefinition = "jsonb")
private String jsonField;
//add your getters and setters
}

Sachini Wickramaratne
- 529
- 3
- 17