Spring 错误:列";xxxxxxx";类型为character variable[],但表达式类型为bytea
我在Spring和使用db postgres时出错Spring 错误:列";xxxxxxx";类型为character variable[],但表达式类型为bytea,spring,postgresql,hibernate,Spring,Postgresql,Hibernate,我在Spring和使用db postgres时出错 org.postgresql.util.PSQLException: ERROR: column "XXXXXXXXXX" is of type character varying[] but expression is of type bytea Hint: You will need to rewrite or cast the expression. 我
org.postgresql.util.PSQLException: ERROR: column "XXXXXXXXXX" is of type
character varying[] but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
我的POJO有如下数据:
@Column(name = "xxxxxxx")
private String[] xxxxxxx;
您可以实现hibernate用户类型接口, 然后将
@Type
注释添加到属性中
例如:
提供更多细节。如果方便的话,放一些代码,可能是
@Column(name = "xxxxxxx")
@Type(type = "xx.xxx.xxx.YourImplementationOfUserType")
private String[] xxxxxxx;