[hibernate-issues] [Hibernate-JIRA] Commented: (HV-232) Modify the BeanValidationEventListener in the annotation project to be configurable via the hibenrate config file

Hardy Ferentschik (JIRA) noreply at atlassian.com
Wed Sep 23 05:09:51 EDT 2009


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

Hardy Ferentschik commented on HV-232:
--------------------------------------

Hardy Ferentschik 10:46 AM
if someone wants to use HV 4 with JPA1, then he just needs to add a copy of BeanValidationEventListener to his code and register it manually, right?
 the listeners and the HibernateTraversableResolver are not JPA2 specific

Emmanuel Bernard 10:47 AM
let me check. I think I did something different than what was present in HV 3
HibernateTraversableResolver is not specific that's for sure

Hardy Ferentschik 10:48 AM
right. I think we should make sure that it is possible for people to use HV 4 with JPA1
people will have to add the resolver and listner classes to their codebase since they won't have the latest annotations code, but otherwsie it should work

Emmanuel Bernard 10:49 AM
I don't think we should if that requires too much work
but you are right it should work
except that they will need to register BeanValidationEventListener programmatically
ie pass an instance
becasue the constructor takes VF and Perperties
so you can't use the XML configuration

Hardy Ferentschik
i see

Emmanuel Bernard 10:51 AM
in theory the spec says you get the VF from javax.persistence.validation.factory
and if not there we create one

Hardy Ferentschik 10:52 AM
so one would need a listener class where you construct your factoty yourself

Emmanuel Bernard 0:52 AM
and we inject this result to the lsitener
yes that would be one solution but you have to understand that it is not fully standard compliant then

Hardy Ferentschik 10:53 AM
i understand

Emmanuel Bernard 10:53 AM
If you:
- make BVEL implement Initializable
- use a flag to know if it's created form the no-arg constructor
- and if that's the case force the VF creation
- and read the list of groups from the configuration
then you have something quite approaching

Hardy Ferentschik 10:54 AM
makes sense



> Modify the BeanValidationEventListener in the annotation project to be configurable via the hibenrate config file
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HV-232
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-232
>             Project: Hibernate Validator
>          Issue Type: Task
>          Components: engine
>            Reporter: Hardy Ferentschik
>             Fix For: 4.0.0.GA
>
>
> Since there is currently no no-arg constructor the listener cannot just be added to the configuration file. Instead it has to be added programmatically. In order to allow easy integration of Hibernate Validator 4 with JPA1 we should add a no-arg constructor.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list