[hibernate-issues] [Hibernate-JIRA] Created: (HV-76) Field annotated member validators does not work with proxied objects

Lucien Weller (JIRA) noreply at atlassian.com
Tue Feb 3 08:12:38 EST 2009


 Field annotated member validators does not work with proxied objects
---------------------------------------------------------------------

                 Key: HV-76
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-76
             Project: Hibernate Validator
          Issue Type: Bug
    Affects Versions: 3.1.0.CR1, 3.0.0.ga
            Reporter: Lucien Weller
         Attachments: proxy-fix.patch, testcase.tar.gz

Copied from subtask HV-68 as subtask of closed issue HV-64 seams not to appear as open issue):

May be annotating validation constraints on field level ist not the best solution, but by now it's explicitly mentioned as a possibility without other indication of restrictions in hibernate validator doc. But obviously this method is not safe with hibernate proxy instances as it is demonstrated be test case attached to original issue (http://opensource.atlassian.com/projects/hibernate/secure/attachment/14092/testcase.tar.gz). My first patch was a quick fix that worked for our case and a agree once again that it may have some side effects as it changes the semantic of field annotation. but my second solution (http://opensource.atlassian.com/projects/hibernate/secure/attachment/14091/proxy-fix.patch) leaves every thing as it is and just handles proxy instances differently and produce a more correct validation result than in current version.

I hope that you can do something with my ideas or a least document this limitation when using field annotation. 

-- 
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