Andremoniy
Andremoniy

Reputation: 34900

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?

Upvotes: 4

Views: 3671

Answers (1)

Andremoniy
Andremoniy

Reputation: 34900

Just add columnDefinition into the column annotation:

@Column(name = "id", columnDefinition = "NUMERIC", length = 20)

Upvotes: 7

Related Questions