【发布时间】:2016-10-31 12:35:31
【问题描述】:
我正在尝试查找某个 DateTime 之后的对象列表。为此,我创建了以下查询:
return foos.retrieve(QueryFactory.equal(EXPIRY_INDEX, new DateTime()));
然后我创建了以下索引:
public static final Attribute<Foo, DateTime> EXPIRY_INDEX = new SimpleAttribute<Foo, DateTime>() {
@Override
public DateTime getValue(Foo foo, QueryOptions queryOptions) {
return foo.getEXPIRY();
}
};
到目前为止一切都很好,除了equal(...) 方法将调用DateTime.equals(...),据我所知,它最终会一直返回false。我需要的是一种调用DateTime.isAfterNow(...) 或DateTime.isAfter(...) 的方法。
我怎样才能找到集合中现在有DateTime 的所有元素?
【问题讨论】:
标签: java datetime jodatime cqengine