【发布时间】:2015-05-18 20:21:36
【问题描述】:
如何使用 objectify 过滤数据存储区的 Date 属性? 我有一个看起来像 pojo 类下面的实体。在这个 timeStamp 是一个保存日期值的属性。
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 属性? 我想检索所有具有特定日期和时间的实体。
【问题讨论】:
标签: google-app-engine google-cloud-datastore objectify