如何使用objectify过滤数据存储区中的Date属性? 我有一个看起来像pojo类的实体。在这个timeStamp中是一个保存Date值的属性。
public class TravelEntry {
private String deviceId;
private String pushedGeoData;
private String location;
private Date timeStamp;
public TravelEntry(){
setTimeStamp(this.timeStamp);
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getPushedGeoData() {
return pushedGeoData;
}
public void setPushedGeoData(String pushedGeoData) {
this.pushedGeoData = pushedGeoData;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Date getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(Date timeStamp) {
if(timeStamp==null){
this.timeStamp = new Date();
}else{
this.timeStamp = timeStamp;
}
}
}
如何使用Objectify查询或过滤Date属性? 我想要检索具有特定日期和时间的所有实体。
答案 0 :(得分:0)