You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Result ret = FluentValidator.checkAll()
.on(company, new HibernateSupportedValidator<Company>().setHibernateValidator(validator))
.on(company, new CompanyCustomValidator())
.doValidate().result(toSimple());
另外
public class HibernateSupportedValidator<T> extends ValidatorHandler<T> implements Validator<T> {
private static javax.validation.Validator HIBERANTE_VALIDATOR;
private int hibernateDefaultErrorCode;
private ConstraintViolationTransformer constraintViolationTransformer = new DefaultConstraintViolationTransformer();
HIBERANTE_VALIDATOR 为static 何解?
The text was updated successfully, but these errors were encountered:
Because Fluent-validator is not bounded to hibernate validator, so it is intend to be created manually. If you think setHibernateValidator is redundant, I suggest using Factory design pattern to build it, note that HibernateSupportedValidator is not thread-safe, must be prototyped.
Validator instance is retrieved from the ValidatorFactory. Validator instances are thread-safe and may be reused multiple times. This is how we use Hibernate in the right way.
另外
HIBERANTE_VALIDATOR 为static 何解?
The text was updated successfully, but these errors were encountered: