[hibernate-issues] [Hibernate-JIRA] Resolved: (HV-350) Inherited Bean validates non-default constraints as default

Hardy Ferentschik (JIRA) noreply at atlassian.com
Mon Jul 5 16:13:14 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HV-350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hardy Ferentschik resolved HV-350.
----------------------------------

       Resolution: Cannot Reproduce
    Fix Version/s: 4.2.0

> Inherited Bean validates non-default constraints as default
> -----------------------------------------------------------
>
>                 Key: HV-350
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-350
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 4.1.0.Final
>         Environment: Spring 3.0.3
>            Reporter: Marc Schipperheyn
>            Assignee: Hardy Ferentschik
>             Fix For: 4.2.0
>
>
> Let's say you have 2 beans
> public class Vehicle{
> 	
> 	@AssertTrue(groups={CheckMaintenance.class,CheckRoad.class})
> 	public boolean oilCheck;
> 	
> 	@NotNull(groups={CheckRoad.class})
> 	public String plate;
> }
> public class Car extends Vehicle{
> 	@Min(value=4)
> 	public int numWheels;
> }
> validate(car,Class<?>[]{Default.class,CheckMaintenance.class});
> If I validate Car, all the Vehicle validations are selected as Defaults as opposed to by their specific marker interface. In other words, Validator validates plate regardless of the fact that CheckRoad is not part of the array of marker interfaces specified for this validation. I assume this has something to do with the inherited nature of the class.
> Stepping through the code, I can also see that the groups Descriptor of the ConstraintDescriptorImpl 'loses' non default groups for the inherited constraints.

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