|
@@ -63,11 +63,11 @@ public abstract class AbstractServiceImpl<Po, PK> implements GenericService<Po,
|
|
|
public void tryValidPo(Po data) {
|
|
|
Set<ConstraintViolation<Object>> set = validator.validate(data);
|
|
|
ValidateResults results = new ValidateResults();
|
|
|
- if (set.isEmpty()) {
|
|
|
+
|
|
|
for (ConstraintViolation<Object> violation : set) {
|
|
|
results.addResult(violation.getPropertyPath().toString(), violation.getMessage());
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
if (!results.isSuccess())
|
|
|
throw new ValidationException(results);
|
|
|
}
|