I have multiple processes in which the bean properties must have different values. Example:
@Min( value=0, groups=ProcessA.class )
@Min( value=20, groups=ProcessB.class )
private int temperature;
Unfortunately the bean validation JSR 303 has not set @Repeatable on javax.validation.constraints.Min so this approach does not work. I found "Min.List" but without any doc about how to use it. Instead the official Oracle doc states at http://docs.oracle.com/javaee/7/api/javax/validation/constraints/class-use/Min.List.html
No usage of javax.validation.constraints.Min.List
So at moment this looks like a specification error?!?
The syntax for Min.List
, as for any other annotation taking an array of annotations as one of its attributes, is
@Min.List({ @Min(value = 0, groups = ProcessA.class),
@Min(value = 20, groups = ProcessB.class) })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With