JPA 2.0 : what is javax.validation.* package?
问题 What is the javax.validation package in Java EE? How to use this with JPA? I want to validate my JPA Entity with the @NotNull annotation. My JPA implementation is Hibernate. Here's my Entity: public class Employee implements Serializable , EmployeeDetail { private static final long serialVersionUID = 1L; @Id @GeneratedValue private int id; private String name; private long salary; ... 回答1: Using the Bean Validation Api you can quite easy ensure standard validation (not null, patterns, email)