[英]repository.findAll() method returns nothing in spring-data
I am trying to get all relationships using spring-data and neo4j. 我正在尝试使用spring-data和neo4j获得所有关系。
My Repository 我的资料库
public interface RelationshipNeo4JRepository extends
GraphRepository<Relationship> {
}
Relationship Class: 关系类:
@RelationshipEntity
public class Relationship {
@GraphId
Long nodeId;
@StartNode
private Node startNode;
@EndNode
private Node endNode;
@Indexed
@RelationshipType
private String type;
//getter setter
} }
When I am trying to use findAll() method, I am not getting any relationships. 当我尝试使用findAll()方法时,没有任何关系。 but I am getting total using count().
但是我正在使用count()获得总计。 Please help me using cypher query or some other way.
请使用密码查询或其他方式帮助我。
I don't think this is something you should use an SDN repository for. 我认为这不是您应该使用SDN存储库的东西。
Just go to the Neo4j API and call: 只需转到Neo4j API并调用:
GlobalGraphOperations.at(db).getAllRelationships();
I solved this using @Query on method in repository. 我在存储库中的方法上使用@Query解决了此问题。
@Query(value="start r=rel(*) return r);
public List<Relationship> getAll();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.