'SpringJPA convert DB2 Negative Numeric type in Positive number
I'm using Spring Boot with JPA and a Db2 database on an AS400 server.
When I inspect the result of a SELECT statement using the debugger tool, the value stored in the volume
column is always positive.
However, when I inspect the value in DBeaver, it is negative.
For example, -10.02 in DBeaver is 10.02 in BigDecimal.
This problem does not occur when I retrieve data from a Postgres database in which the column has the same type and the same precision.
@Column(name = "volume", nullable = false, precision=9, scale=3)
private BigDecimal volume;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|