[
http://opensource.atlassian.com/projects/hibernate/browse/BVAL-208?page=c...
]
Emmanuel Bernard commented on BVAL-208:
---------------------------------------
I had two use cases in mind:
* define the group to validate in a method level annotation (parameter etc)
* let a user redefine the group to validate when cascaded (useful when aggregating object
graphs)
Both use cases are well described by Arthur in #comment-38181
Note that @Valid left alone would still fulfill the default specification interpretation.
But one could envision a "NAT" style transformation from one group to another
when a @Valid barrier is crossed.
{code}(a)Valid(before={Simple.class, Heavy.class}, after={Easy.class,
Default.class}){code}
When Simple.class is validated in the mail object, Easy.class is validated on the cascaded
object.
When Heavy.class is validated in the mail object, Default.class is validated on the
cascaded object.
A couple of problems to resolve:
* what about circular dependencies involving different groups "for a while" (ie
Default on the nested object validates back the root object).
* what about group sequences. Should direct groups be translated, or should inner groups
be too? What about inconsistencies in this case (ie the translated group sequence
violating group sequence rules).
Note that I had in mind to reuse @Valid but it might be better to have one (or even two)
additional annotations for these notions (ie the cascading, the group translation, the
method-levle group definition.
@Valid should support groups attribute
--------------------------------------
Key: BVAL-208
URL:
http://opensource.atlassian.com/projects/hibernate/browse/BVAL-208
Project: Bean Validation
Issue Type: Improvement
Affects Versions: 1.0 final
Reporter: Marc Schipperheyn
The @Valid annotation should implement the group attribute in order to make validation
completely annotation driven. Currently, we need to manually call the validate method on
the validator if we want to validate based on groups.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira