[Prev] Thread [Next] |
[Prev] Date [Next]
[hibernate-dev] Re: Groups are represented by interfaces
Thu Jun 18 08:01:34 2009
On Jun 18, 2009, at 09:36, Hardy Ferentschik wrote:
another question. The spec says that groups are interfaces, but it
is not specific about what happens if non interface classes
are passed to validate:
* Validates all constraints on object.
* @param object object to validate
* @param groups groups targeted for validation
* (default to [EMAIL PROTECTED] javax.validation.groups.Default})
* @return constraint violations or an empty Set if none
* @throws IllegalArgumentException if object is null
* @throws ValidationException if a non recoverable error happens
* during the validation process
<T> Set<ConstraintViolation<T>> validate(T object, Class<?>...
Should an IllegalArgumentException be thrown if the class is not an
I don't want the spec to limit innovation, That's why the exception
model is not specified. Some product can support Class groups.
Related to this:
"Since sequences cannot have circular dependencies, using Default in
the declaration of a sequence is not an op-
tion. Constraints hosted on a class A and belonging to the Default
group (by default or explicitly) implicitly belong
to the group A."
Does this imply I should be able to call
Validator.validate(aInstance, A.class)? That would violate the
groups are interfaces. Is group A just a "conceptual" group?
Yes A is a conceptual group.
PS: let's have these discussions on hibernate-dev. People can share
that and that will be searchable.
hibernate-dev mailing list