我必须对我的实体干预的字段“heureFin”和“heureDebut”设置一个约束,我想知道如何精确这个约束:heureFin>heureDebut?这是我的实体:
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;
}
是否有可能,或者我应该在其他地方处理这个约束?
先感谢您 :)