I wan't to make a progress bar so I need to know how many constraints and how many violations
with a @Resource private Validator validator;
number of constraint could be known by : validator.getConstraintsForClass(entity.getClass()).getConstrainedProperties().size()
and violation could be known by : validator.validate(entity, Submit.class).size()
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
|