Consider the following
@Entity
@Table
@Check(constraints = "A IS NOT NULL OR B IS NOT NULL")
public class Model {
@Id
private Long id;
private A a;
private B b;
}
Problem is I do not know how I can name the checkConstraint ? What I want is something like @Check(constraints = @Constraint("name"="CHK_CONST_1", "A IS NOT NULL OR B IS NOT NULL"))