2016-05-24 10 views
1

Ich bin von SDN 3 bis SDN 4 und von Neo4j 2.3 bis 3.0.1Neo4j 3.0.1 - org.neo4j.ogm.exception.CypherException: Fehler beim Ausführen von Cypher

auf der rechten Seite jetzt mein Test nicht bewegen folgende Cypher Abfrage:

MATCH (d:Decision)<-[:VOTED_FOR]-(vg:VoteGroup)-[:VOTED_ON]->(c:Criterion) WHERE id(d) = {decisionId} AND id(c) = {criterionId} WITH vg MATCH vg-[:CONTAINS]->(v:Vote)-[:CREATED_BY]->(u:User) WHERE id(u) = {userId} RETURN v 

mit folgenden Ausnahme:

org.neo4j.ogm.exception.CypherException: Error executing Cypher 
    at org.neo4j.ogm.drivers.embedded.request.EmbeddedRequest.executeRequest(EmbeddedRequest.java:176) 
    at org.neo4j.ogm.drivers.embedded.request.EmbeddedRequest.execute(EmbeddedRequest.java:71) 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.executeAndMap(ExecuteQueriesDelegate.java:110) 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:82) 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.queryForObject(ExecuteQueriesDelegate.java:56) 
    at org.neo4j.ogm.session.Neo4jSession.queryForObject(Neo4jSession.java:308) 
    at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:78) 
    at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:52) 
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482) 
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) 
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) 
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) 
    at com.sun.proxy.$Proxy126.findVoteForDecisionOnCriterionByAuthorId(Unknown Source 

Diese Abfrage funktioniert auf Neo4j 2.3

Was kann ein Grund dafür sein und wie kann man es beheben?

Antwort

1

Ich vermute es liegt daran, dass Neo4j 3 keine nackten Knoten mehr mag. Ich änderte MATCH vg zu MATCH (vg):

MATCH (d:Decision)<-[:VOTED_FOR]-(vg:VoteGroup)-[:VOTED_ON]->(c:Criterion) 
WHERE id(d) = {decisionId} AND id(c) = {criterionId} 
WITH vg 
MATCH (vg)-[:CONTAINS]->(v:Vote)-[:CREATED_BY]->(u:User) 
WHERE id(u) = {userId} 
RETURN v 
+0

Danke, jetzt arbeitet ohne Fehler – brunoid