我有一个名称为 Task 的表,如下所示,该表的属性为 stopTime
@Entity
@Table(name = "task", schema = "public")
public class Task {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotEmpty
private String date;
@NotEmpty
private String startTime;
@NotEmpty
private String stopTime;
@NotEmpty
@Column(length=1000)
private String description;
@ManyToOne
@JoinColumn(name="USER_EMAIL")
private User user;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getStopTime() {
return stopTime;
}
public void setStopTime(String stopTime) {
this.stopTime = stopTime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
现在,我要在 PostgreSQL 中进行查询,以选择所有已超过截止日期的任务,如下所示:
@Query("select stopTime from Task where ")
List<String> deleteAll();
。建议将任务的停止时间与当前时间进行比较。请帮助我完成此查询。 预先感谢!