1
我必須在實體干預的字段「heureFin」&「heureDebut」上設置一個約束條件,我不知道如何精確限制這個約束:heureFin> heureDebut ?? 這裏是我的實體:在實體中指定表示日期的字段上的約束條件JPA
public class Intervention implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Size(min = 1, max = 50)
@Column(name = "IdIntervention", length = 50)
private String idIntervention;
@Basic(optional = false)
@NotNull
@Column(name = "HeureDebut", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date heureDebut;
@Basic(optional = false)
@NotNull
@Column(name = "HeureFin", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date heureFin;
}
是否有可能,還是應該在其他地方處理這個約束?
先謝謝您:)
感謝您對尼古拉幫助:) – mounaim