我是Spring Data Jpa的新手
我有以下对象
public class VehicleDetail {
private long vehicleDetailId;
@OneToMany(mappedBy = "vehicleDetail")
private List<NonAvailabilityStatus> nonAvailabilityStatus = new ArrayList<NonAvailabilityStatus>();
}
public class NonAvailabilityStatus{
private long nonAvailabilityStatusId;
@Column(name="START_DT_TM")
private Date nonAvailabiltyStartDateTime;
@Column(name="END_DT_TM")
private Date nonAvailabiltyEndDateTime;
}
我想使用方法名称查询检查当前日期和当前日期+ 1是否在nonAvailabiltyStartDateTime
和nonAvailabiltyEndDateTime
之间重叠。我试过了findByNonAvailabilityStatusNonAvailabiltyStartDateTimeIsBeforeAndNonAvailabilityStatusNonAvailabiltyEndDateTimeAfter(Date startDate, Date endDate)
,但它没有用。