6

I am using the Play Framework with Ebean and H2 database.

The problem is, the BigDecimal results in the DB script as:

  sum                       decimal(38),

but what I want is:

  sum                       decimal(38,2),

I already tried to define the value in the model like that:

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

Any ideas?

Thomas Mueller
  • 48,905
  • 14
  • 116
  • 132

1 Answers1

10

You should use @Column(precision = 38, scale = 2) annotation. @Digits annotation seems to be for validation purposes, not for DDL generation.

Also 38 looks like overkill. Are you gonna store all money on earth? :)

Leo
  • 2,097
  • 21
  • 35
  • 1
    thank you for your reply, I'll try that :) Haha, no it was the standard value so I was fine with that but yes I would like to – user2187263 Mar 27 '13 at 11:26