简体   繁体   中英

Validation Spring3 + Hibernate

I try validate a BigDecimal field as the next:

@DecimalMin(value = "0.00", message = "message error validation") private BigDecimal saldoFechaDefunProducto;

But I get the next error: javax.validation.ConstraintViolationException: validation failed for classes...

Can anybody help me please?

you can validate like this :

@Digits(integer=0, fraction=2)
@Column(name = "saldoFechaDefunProducto") 
private BigDecimal saldoFechaDefunProducto;

and this like can help you Hibernate Validator

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM