Reputation: 69
public class User {
@NotBlank
private String name;
@???
private String email;
@???
private String mobile;
}
how can i write rule with hibernate validator(@???), like this code:
StringUtils.hasText(email) || StringUtils.hasText(mobile)
Upvotes: 0
Views: 24
Reputation: 19109
You need to look at how to implement class level constraints. This feature is described in the Bean Validation specification as well as the Hibernate Validator online docs.
Upvotes: 1