은 가정 간단한 사이퍼 쿼리 두 개의 노드 실체가 :Neo4J -
public interface AccountRepository extends GraphRepository<Account>
{
@Query("START account=node:Account(0) MATCH account-[:HAS_ROLE]->({0}) return account")
Iterable<Account> findByRole(Role role);
}
그러나이 쿼리 :
내 저장소에서public class Account extends BaseEntity
{
...
@Fetch
@RelatedTo(type = "HAS_ROLE")
private Set<Role> roles = Sets.newHashSet();
...
}
public class Role extends BaseEntity
{
...
}
, 나는 주어진 역할의 모든 계정을 얻어야한다 쿼리가 작동하지 않습니다. 테스트 케이스에서이 메서드를 사용하면 다음과 같은 오류가 발생합니다.
org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START account=node:Account(0) MATCH account-[:HAS_ROLE]->({0}) return account; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START account=node:Account(0) MATCH account-[:HAS_ROLE]->({0}) return account; nested exception is expected string
내 검색어와 함께 rong,하지만 난 뭘 모르겠지만 아직 그것을 알아낼 수 없습니다 ... 누구 도움을 줄 수 있을까요?
사용되는 Neo4j의 버전을 지정하십시오. 중요합니다. – raina77ow
neo4j 1.8.M07, spring-data-neo4j 2.1.0.BUILD-SNAPSHOT –
을 사용하고 있습니다. 직접 답변을 수락하거나 답변하십시오. 당신이 솔루션을 가지고있는 것처럼 보입니다 ("나는 그것을 ... 그리고 모든 것이 잘되었습니다.") 그리고이 질문을 끝내는 것이 좋을 것 같습니다! – cod3monk3y