If a constraint which has both a generic and a cross-parameter validator is given via its annotation on a method with return value and parameters, the target of the constraint must be specified using the validationAppliesTo attribute.
If such a constraint is given via XML, the target can be derived from the surrounding context (either <return-value> or cross-parameter). Therefore it should not be required to specify the target again as element. While Hibernate Validator derives the target in this case (see HV-769), the spec currently doesn't require this behavior, though.
|