Play Framework Ebean BigDecimal fraction

I am using the Play platform with an Ebean and H2 database.

The problem is what BigDecimalleads to the DB script like:

  sum                       decimal(38),

but I want:

  sum                       decimal(38,2),

I have already tried to determine the value in the model as follows:

    @Digits(integer=6, fraction=2)
    private BigDecimal sum;

Any ideas?

+5
source share
1 answer

You should use the @Column annotation (precision = 38, scale = 2) . @Digits annotations seem to be for verification, not for generating DDL.

Also 38 looks redundant. Are you going to keep all the money on earth? :)

+8
source

All Articles