Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL and Hibernate: Found: numeric, expected: int8

I have table in PostgreSQL which contains column with type numeric(20).

I have mapped this column on field of type Long.

While validation part hibernate gives me an exception, saying: Found: numeric, expected: int8. I can not change type of column in the database, how to solve it?

like image 994
Andremoniy Avatar asked Mar 12 '23 09:03

Andremoniy


1 Answers

Just add columnDefinition into the column annotation:

@Column(name = "id", columnDefinition = "NUMERIC", length = 20)
like image 153
Andremoniy Avatar answered Mar 19 '23 08:03

Andremoniy