hibernate-dev
[Prev] Thread [Next] | [Prev] Date [Next]
[hibernate-dev] Re: Groups are represented by interfaces Emmanuel Bernard Thu Jun 18 08:01:34 2009
On Jun 18, 2009, at 09:36, Hardy Ferentschik wrote:
Hi,another question. The spec says that groups are interfaces, but it is not specific about what happens if non interface classesare 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<?>... groups);Should an IllegalArgumentException be thrown if the class is not an interface?
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 belongto the group A."Does this imply I should be able to call Validator.validate(aInstance, A.class)? That would violate the statement thatgroups 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.
--Hardy
_______________________________________________ hibernate-dev mailing list [EMAIL PROTECTED] https://lists.jboss.org/mailman/listinfo/hibernate-dev
- [hibernate-dev] Re: Groups are represented by interfaces Emmanuel Bernard <=