📅  最后修改于: 2022-03-11 15:00:19.703000             🧑  作者: Mango
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
Set> violations = validator.validate( notionalProviderPaymentDTO );
if(!violations.isEmpty()) {
throw new ConstraintViolationException(violations);
}