|
|
|
I wan't to make a progress bar so I need to know how many constraints and how many violations
with a {code} @Resource private Validator validator; {code} number of constraint could be known by : {code} validator.getConstraintsForClass(entity.getClass()).getConstrainedProperties().size() {code} and violation could be known by : {code} validator.validate(entity, Submit.class).size() {code} but the validate method don't work for not loaded hibernate lazy collections annotated with {{ @Size }} or {{ @NotEmpty }} (neither with the annotations on fields nor on getters)
To solve that issue I validate each constraints "manually" with the Validate.validateValue() method
|
|
|
|