How to add validation checks spanning multiple fields in a JPA entity. If birthDate is present, then deathDate should be higher than birthDate. How do I enforce it
@Entity
@Table(name = "users")
public class User {
private Date birthDate;
private Date deathDate;
}