Have a look at this answer: Hibernate Validating collections of primitives . This describes a solution that works for you, but it is rather complicated. A simpler solution would be to implement a wrapper class for Integer and declare @Min and @Max in this class. Than you can use
@Valid private Set<MyIntegerWrapper> monthNumbers;
class MyIntegerWrapper:
class MyIntegerWrapper { @Min(1) @Max(12) Integer myInteger; }
Here you will find documentation for @Valid : Object Graphs
source share