[hibernate-issues] [Hibernate-JIRA] Created: (BVAL-245) Define how method constraints are declared at parameters and return values

Gunnar Morling (JIRA) noreply at atlassian.com
Sun Sep 25 06:55:35 EDT 2011


Define how method constraints are declared at parameters and return values
--------------------------------------------------------------------------

                 Key: BVAL-245
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-245
             Project: Bean Validation
          Issue Type: Sub-task
          Components: spec-general
            Reporter: Gunnar Morling
             Fix For: 1.1


Emmanuel:

{quote}
Constraints on parameters whose type is a subtype of the accepted types by the constraint are declared directly on the parameter

   void doHarm(@NotEmpty String kittenName);

Constrains on parameters whose type is a constrained bean needs an annotation accepting the targeted groups. It was proposed to use @Valid for such case but [recent discussions|https://hibernate.onjira.com/browse/BVAL-208?focusedCommentId=43533#comment-43533] brought that back on the drawing board.

There are a few notions floating around @Valid

1. cascade validation to nested beans
2. translate the validation of group A from the owning bean to validation of the group B on the nested bean (see BVAL-208)
3. define the group to validate in a method level validation

About 3., I wonder if this should be part of Bean Validation or be part of the interception framework. In other words:

* should it be an annotation provided / proposed by Bean Validation and recognized by interception techs like CDI, @Inject, Spring, AspectJ etc
* should each interception tech provide its own annotation to specify the targeted group(s)
{quote}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list