We are using H2 database for testing purposes, but when I store BigDecimal value into it using Hibernate and then load it back the value is truncated to two decimal places:
The field definition looks like this
@Column(name = "Rate", nullable = true)
private BigDecimal rate;
so 1.456 is truncated into 1.46.
I don't know the precision upfront (it is different for every entity), so I can't define them on the annotation.
Is there some way how to resolve this?
SCRIPT
in the H2 database? – Linchpin