我有一个名为“Scheduler”的类,它有 7 个布尔字段。我想在休眠中编写一个约束来检查至少一个布尔字段是否为真。
这是“调度程序”类。
public class Scheduler {
private String description;
@NotNull
private Boolean sMondays;
@NotNull
private Boolean sTuesdays;
@NotNull
private Boolean sWednesdays;
@NotNull
private Boolean sThursdays;
@NotNull
private Boolean sFridays;
@NotNull
private Boolean sSaturdays;
@NotNull
private Boolean sSundays;
public Scheduler() {
}
}
谁能帮我写下提到的约束。
谢谢!!!!!!!!!