How to validate a List<BigDecimal> with @DecimalMin and @DecimalMax?

心已入冬 提交于 2019-12-01 13:16:31

We implemented container element constraints in Hibernate Validator 6.0.x.

So upgrade to Hibernate Validator 6.0.x (6.0.9.Final is the latest) and Bean Validation 2.0.1 and do as follows:

@Size(...)
private List<@DecimalMin(...) @DecimalMax(...) BigDecimal> cmykColor;

Be careful, the groupId of Hibernate Validator 6.0 is org.hibernate.validator.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!