All the validation methods have a var-args parameter which can be used to specify, which validation groups shall be considered when performing the validation.
If the parameter is not specified the default validation group ( gets evaluated.
If a group containing such a circularity is evaluated, a for this class.
If the object is a collection or an array, the elements are validated recursively.
Class level constraints are useful if it is necessary to inspect more than a single property of the class to validate it or if a correlation between different state variables has to be evaluated.
In Example 2.3, “Class level constraint” we add the property When validating an object that implements an interface or extends another class, all constraint annotations on the implemented interface and parent class apply in the same manner as the constraints specified on the validated object itself.
With this definition the check for all three groups can be rewritten as seen in Example 2.20, “test Ordered Checks With Redefined Default”.
Hibernate Validator implements all of the default constraints specified in Bean Validation as well as some custom ones.