[hibernate-issues] [Hibernate-JIRA] Created: (HV-265) Constraints not loaded consistently for inherited classes

Jaro Kuruc (JIRA) noreply at atlassian.com
Thu Oct 29 11:02:12 EDT 2009


Constraints not loaded consistently for inherited classes
---------------------------------------------------------

                 Key: HV-265
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-265
             Project: Hibernate Validator
          Issue Type: Bug
          Components: mapping
    Affects Versions: 4.0.1
         Environment: Win XP, Sun Java 1.6
            Reporter: Jaro Kuruc
         Attachments: hibernate-validator-tests.zip

Hi, please find attached project demonstrating inconsistency in loading constraints when using annotations vs. XML mappings. This is sometimes causing that validator does not validate field 'detail.competition.name' in org.hibernate.validator.xml.Competition class.

The test demonstrates 3 cases:

1. Using default configuration on top of annotated beans - works as expected
2. Using explicit configuration mappings on top of annotated beans - works as expected
3. Using explicit configuration mappings on top of non-annotated beans - does not work as expected

The third case works only if both subclasses of org.hibernate.validator.xml.Competition (org.hibernate.validator.xml.PersonCompetition and org.hibernate.validator.xml.TeamCompetition) are defined in mappings file as beans, even though they are not adding any new fields to validate. The problem is that in this case, the field they inherited is ignored by validator and not validated.

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