JSR-303 dependency injection and Hibernate

前端 未结 6 1723
长发绾君心
长发绾君心 2020-12-05 12:02

Spring 3.0.2, Hibernate 3.5.0, Hibernate-Validator 4.0.2.GA

I am trying to inject Spring dependencies into a ConstraintValidator using:

@PersistenceC         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 12:41

    There is also the option to pass the ValidatorFactory as property to the entity manager creation using the property javax.persistence.validation.factory. If there is a ValidatorFactory instance stored under this property, the entity manager uses this validator factory instead of creating a new one.

提交回复
热议问题