So I have a constraint validation defined as follows:
Code:
@Target(value={ElementType.METHOD,ElementType.FIELD,ElementType.ANNOTATION_TYPE,ElementType.CONSTRUCTOR,ElementType.PARAMETER})
@Retention(value=RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = AllowedValuesValidator.class)
public @interface AllowedValues {
String[] values();
String message() default "{com.test.AllowedValues.message}";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default {};
}
And I want to tell the user the list of allowed values when validation fails. I tried adding:
Code:
com.test.AllowedValues.message=must be one of {values}
to the ValidationMessage.properties and what I get is:
Quote:
must be one of [Ljava.lang.String;@536b98c3
is there a sytax I can use in the ValidationMessage.properties to tell hibernate to list all of the elements?
thanks,
matt