[hibernate-issues] [Hibernate-JIRA] Updated: (HV-353) Support inheritance for marker interfaces

Hardy Ferentschik (JIRA) noreply at atlassian.com
Thu Jul 15 05:41:13 EDT 2010


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

Hardy Ferentschik updated HV-353:
---------------------------------

      Description: 
Currently, constraints use marker interface specified in the group attribute to determine whether a constraint is active for a certain context. 

Unfortunately, group membership doesn't seem to support inheritance which would greatly reduce the number of markers required (and processing since you need less markers).

E.g. (contrived)
{code}
public interface CheckVehicle{}
public interface CheckCar extends CheckVehicle{}
public interface CheckBicycle extends CheckVehicle{}

//bean
@AssertTrue(groups={CheckVehicle.class})
Boolean workingBrakes()

@NotNull(groups={CheckBicycle.class})
String brakeType()
{code}

If the active group is CheckBicycle, it should validate  both workingBrakes and brakeType.

It should be a relatively simply change as well. 



  was:
Currently, constraints use marker interface specified in the group attribute to determine whether a constraint is active for a certain context. 

Unfortunately, group membership doesn't seem to support inheritance which would greatly reduce the number of markers required (and processing since you need less markers).

E.g. (contrived)
public interface CheckVehicle{}
public interface CheckCar extends CheckVehicle{}
public interface CheckBicycle extends CheckVehicle{}

//bean
@AssertTrue(groups={CheckVehicle.class})
Boolean workingBrakes()

@NotNull(groups={CheckBicycle.class})
String brakeType()

If the active group is CheckBicycle, it should validate  both workingBrakes and brakeType.

It should be a relatively simply change as well. 



    Fix Version/s: 4.2.0
      Component/s:     (was: annotation-processor)
                   engine

> Support inheritance for marker interfaces
> -----------------------------------------
>
>                 Key: HV-353
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-353
>             Project: Hibernate Validator
>          Issue Type: Improvement
>          Components: engine
>    Affects Versions: 4.1.0.Final
>            Reporter: Marc Schipperheyn
>            Assignee: Hardy Ferentschik
>             Fix For: 4.2.0
>
>
> Currently, constraints use marker interface specified in the group attribute to determine whether a constraint is active for a certain context. 
> Unfortunately, group membership doesn't seem to support inheritance which would greatly reduce the number of markers required (and processing since you need less markers).
> E.g. (contrived)
> {code}
> public interface CheckVehicle{}
> public interface CheckCar extends CheckVehicle{}
> public interface CheckBicycle extends CheckVehicle{}
> //bean
> @AssertTrue(groups={CheckVehicle.class})
> Boolean workingBrakes()
> @NotNull(groups={CheckBicycle.class})
> String brakeType()
> {code}
> If the active group is CheckBicycle, it should validate  both workingBrakes and brakeType.
> It should be a relatively simply change as well. 

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