0

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?

Vikrant
  • 4,920
  • 17
  • 48
  • 72

1 Answers1

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

}