![](/img/trans.png)
[英]How to retrieve the annotations (JPA and Hibernate) of a field of a POJO in a JSP page
[英]how to map json field with jpa or hibernate in pojo?
我正在使用 MySQL 和 jpa/hibernate。
所以我想要 JPA 中的 Json 数据类型列,但它不支持。
因此,我也无法在标准查询中使用。
哪些是处理这个问题的合适方法?
这对我有用
@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
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.