I have the following bean class which is submitted from jsp form. And i need to validate it before saving to DB. But i want to ignore the collection field from form validation as it returns null from form always. I can remove that field altogether, but i am using this same bean class for some other scenario where i need collection in this bean. So is there any annotation or way to ignore the collection field from validating?
@Setter
@Getter
public class ProvGroup {
private long provGrpId;
@NotNull(message = "This field is required.")
@NotEmpty(message = "This field is required.")
@NotBlank(message = "This field is required.")
private String provGrpName;
private String description;
@NotNull(message = "This field is required.")
@NotEmpty(message = "Add at least one provider to table.")
private String provGrpProvs;
private List<Provider> providers; <--- I need to ignore this from validation
}