[英]Combine Neo4j, Spring Data and Neo4j Predicates
I found org.neo4j.helpers.Predicate
interface. 我找到了org.neo4j.helpers.Predicate
接口。 I use Neo4j and Spring Data. 我使用Neo4j和Spring Data。 I have a repository like this: 我有一个像这样的存储库:
public interface RelationRepository extends GraphRepository<Relation> {
}
But when I want to call relationRepository.findAll(new MyPredicate())
it does not work. 但是,当我想调用relationRepository.findAll(new MyPredicate())
它不起作用。 There is no method created for consuming predicates. 没有创建使用谓词的方法。 Is there any way to combine it all together? 有什么办法可以将它们组合在一起吗?
You can use QueryDSL predicates with QueryDslRepository. 您可以将QueryDSL谓词与QueryDslRepository一起使用。
see this section: http://docs.spring.io/autorepo/docs/spring-data-neo4j/3.3.0.M1/reference/html/#reference_programming-model_repositories 请参阅本节: http : //docs.spring.io/autorepo/docs/spring-data-neo4j/3.3.0.M1/reference/html/#reference_programming-model_repositories
or the tests: 或测试:
https://github.com/spring-projects/spring-data-neo4j/blob/master/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/CypherDslRepositoryTests.java https://github.com/spring-projects/spring-data-neo4j/blob/master/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/CypherDslRepositoryTests.java
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.