Open xiaolongyuan opened 6 years ago
1) 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.
2) 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 何解?