user1646373
user1646373

Reputation: 149

ERROR: column "xxxxxxx" is of type character varying[] but expression is of type bytea

I am getting Error in Spring and using 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.

My POJO have data_member like:

@Column(name = "xxxxxxx")
private String[] xxxxxxx;

Upvotes: 2

Views: 9012

Answers (1)

florbonansea
florbonansea

Reputation: 61

You can implement hibernate UserType interface, and then add @Type annotation to your attribute.

Example:

@Column(name = "xxxxxxx")
@Type(type = "xx.xxx.xxx.YourImplementationOfUserType")
private String[] xxxxxxx;

Upvotes: 1

Related Questions