[hibernate-issues] [Hibernate-JIRA] Commented: (HV-546) LazyValidatorFactory does not allow alternative bean validation providers

Scott Marlow (JIRA) noreply at atlassian.com
Tue Jan 3 09:38:20 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44834#comment-44834 ] 

Scott Marlow commented on HV-546:
---------------------------------

To help with serializing, I started making some changes in https://github.com/scottmarlow/jboss-as/tree/cluster7/jpa/core/src/main/java/org/jboss/as/jpa/validator, but probably need more changes.

https://github.com/scottmarlow/jboss-as/blob/cluster7/jpa/core/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitDeploymentProcessor.java#L253 is where we create the HV instance currently.

In order to support deployments that contain their own validator on AS7, I think we would need two code changes.  
1.  something to detect the validator in the deployment and set a DeploymentUnit reference to it.  This would be similar to https://github.com/scottmarlow/jboss-as/blob/cluster7/jpa/core/src/main/java/org/jboss/as/jpa/processor/PersistenceProviderProcessor.java which detects if a persistence provider is in the deployments and saves a reference to it.
2.  A change to PersistenceUnitDeploymentProcessor.java#L253 to use the DeploymentUnit specified validator.

> LazyValidatorFactory does not allow alternative bean validation providers
> -------------------------------------------------------------------------
>
>                 Key: HV-546
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-546
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 4.2.0.Final
>            Reporter: Hardy Ferentschik
>             Fix For: 4.3.0.next
>
>
> The current implementation of _LazyValidatorFactory_ does not allow alternative validation providers. The idea of the class is to make sure that Hibernate Validator is the default (it should be the first returned), but it should also allow for custom providers. For this to work logic as in _Validation#DefaultValidationProviderResolver_ is needed. 
> The same problem applies to _org.jboss.as.ee.beanvalidation.LazyValidatorFactory_ and _org.jboss.as.jpa.validator.JPALazyValidatorFactory_.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list