在查询java.util.Date
属性上的关系时,我应该使用什么语法?我尝试只使用类似的查询(这只是一个显示我正在尝试做的事情的示例,所以请不要注意那里的变量名):
@Query("start n1=node({0}) match n1-[r:TYPE]->n2 where r.dateCreated>={1} return r")
Page<Relationship> findAll(Node node, long date, Pageable pager);
但它会引发以下错误:
Caused by: Don't know how to compare that. Left: 1339845862883; Right: 1339827156836
at org.neo4j.cypher.internal.Comparer$class.compareValuesOfDifferentTypes(Comparer.scala:45)
at org.neo4j.cypher.internal.Comparer$class.compare(Comparer.scala:67)
at org.neo4j.cypher.commands.ComparablePredicate.compare(ComparablePredicate.scala:30)
at org.neo4j.cypher.commands.ComparablePredicate.isMatch(ComparablePredicate.scala:41)
at org.neo4j.cypher.internal.pipes.matching.PatternMatcher$$anonfun$isMatchSoFar$1.apply(PatternMatcher.scala:148)
at org.neo4j.cypher.internal.pipes.matching.PatternMatcher$$anonfun$isMatchSoFar$1.apply(PatternMatcher.scala:148)
我也尝试通过传递一个日期,但它只是抛出相同的错误,但试图比较一个长和一个日期。
我正在使用 spring-data-neo4j 版本 2.0.1.RELEASE