@Digits (javax.validation)

The @javax.validation.constraints.Digits annotation is recognized by Apache Causeway as a means to specify the precision for properties and action parameters of type java.math.BigDecimal.

For example:

    scale=2                                              (1)
    fraction=2                                           (2)
public BigDecimal getCost() {
    return cost;
public void setCost(final BigDecimal cost) {
    this.cost = cost!=null
        ? cost.setScale(2, BigDecimal.ROUND_HALF_EVEN)   (3)
1 the @Column#scale attribute must be …​
2 …​ consistent with @Digits#fraction()
3 the correct idiom when setting a new value is to normalized to the correct scale