Reputation: 34900
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?
Upvotes: 4
Views: 3671
Reputation: 34900
Just add columnDefinition
into the column annotation:
@Column(name = "id", columnDefinition = "NUMERIC", length = 20)
Upvotes: 7