Hibernate @NotEmpty annotation equivalent in Javax.package or alternative
NotEmpty is just a combination of @NotNull
and @Size(min=1)
.
Please be aware that @NotEmpty will return valid for a List<> containing a null element.
Kind of bizarre in the case of a @QueryParam List<>
As say Affe, I did a custom annotation, itself annotated with @NotNull and @Size(min=1) with a custom validator that iterates the collection and positions a boolean flag only if the elements are not null.