[hibernate-issues] [Hibernate-JIRA] Resolved: (HV-433) Cascaded validation on superclass fields does not work if only @Valid is used
Hardy Ferentschik (JIRA)
noreply at atlassian.com
Fri Feb 25 04:49:09 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hardy Ferentschik resolved HV-433.
----------------------------------
Resolution: Fixed
> Cascaded validation on superclass fields does not work if only @Valid is used
> -----------------------------------------------------------------------------
>
> Key: HV-433
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-433
> Project: Hibernate Validator
> Issue Type: Bug
> Components: engine
> Affects Versions: 4.1.0.Final
> Environment: Java 1.5.0 (IBM J9 2.3); Hibernate Validator 4.1.0.FINAL
> Reporter: Christian Quanz
> Assignee: Hardy Ferentschik
> Fix For: 4.2.0.Beta2
>
>
> Cascaded fields are not validated if the following applies:
> - Only @valid is specified for a particular field, no further constraints
> - Validation takes place on an object of a sublcass of the class where the field to be validated is defined
> Simply no validation will take place on the object assigned to the field. Eyerything works fine if I add another constraint definition, e.g., @NotNull to the field, as in the examples in the documentation. If I validate an object of the class where the field is defined, it also works. I doubt that it matters, but the field's visibility is "protected".
> I tested it for XML constraint definitions and programmatic constraint definitions.
> I could trace the error back to BeanMetaDataImpl->initFieldConstraints(...), where the flag cachedFieldIsCascaded will be false. Thus, addCascadedMember(...) will not be called for the field.
> In case of any additional constraint being defined, the flag cachedFieldIsCascaded will be true.
> Hope that helps.
--
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