Java EE中的javax.validation
包是什么?如何将其与JPA一起使用?
我想用注释验证我的 JPA实体。@NotNull
我的 JPA 实现是Hibernate。
这是我的实体:
public class Employee implements Serializable , EmployeeDetail {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
private int id;
private String name;
private long salary;
...