[hibernate-issues] [Hibernate-JIRA] Commented: (HV-324) Default annotation not executing when group selector activated

Hardy Ferentschik (JIRA) noreply at atlassian.com
Tue May 18 05:39:11 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37184#action_37184 ] 

Hardy Ferentschik commented on HV-324:
--------------------------------------

{{Default.class}} is the default groups for constraints where no specific groups is specified. This group is validated if any of the {{Validator.validate}} methods is called with no value specified for the {{groups}} varargs argument. Once you specify a group or a list of groups only these groups are evaluated. So the behavior you describe is indeed a design behavior. I think looking at the examples in the online doc and the spec it is also quite clear how this works.

> Default annotation not executing when group selector activated
> --------------------------------------------------------------
>
>                 Key: HV-324
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-324
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 4.1.0.Beta1
>            Reporter: Marc Schipperheyn
>            Assignee: Hardy Ferentschik
>             Fix For: 4.1.0
>
>         Attachments: RegistrationVO.java
>
>
> When you call the validate function with a non-default group selector active, the default constraints do not execute. AFAIC this is unexpected behaviour. Default constraints by their very nature should always execute. Also, since it's very easy to exclude default execution by applying a non-default group selector.
> If this is in fact a design decision then the documentation should make very, *very* clear (e.g. through one of those "Notes": Default constraints do NOT execute when a group selector is active! If you want the default to be executed, also add Default.class to the set of group selectors you specify) that default constraints do not execute when a group constraint is active. It doesn't at the moment and I was caught by surprise. 

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