2

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;
Vinay Veluri
  • 6,671
  • 5
  • 32
  • 56
user1646373
  • 149
  • 1
  • 2
  • 6

1 Answers1

1

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;
pringi
  • 3,987
  • 5
  • 35
  • 45
florbonansea
  • 61
  • 1
  • 1