2016-07-10 14 views
0

にNODEを読み込むことができません:SpringデータNeo4j Neo.ClientError.Statement.EntityNotFound;説明:私は、次のNeo4jスキーマを持っているID

enter image description here

私はサイファークエリを使用して、次のSDN 4.2.0.BUILD-SNAPSHOTリポジトリを持つノードを削除しようとしている:

@Query("MATCH (d:Decision) WHERE id(d) IN {decisionsIds} OPTIONAL MATCH (d)<-[:COMMENTED_ON*]-(com:Comment) DETACH DELETE com WITH d OPTIONAL MATCH (d)<-[:DEFINED_BY]-(c) WITH d, c OPTIONAL MATCH (c)<-[:VOTED_ON]-(vg) WITH d, c, vg OPTIONAL MATCH (vg)-[:CONTAINS]->(v) DETACH DELETE v, vg, c, d") 
void deleteDecisions(@Param("decisionsIds") List<Long> decisionsIds); 

今すぐこのメソッドの実行後に次の例外が発生します。

org.neo4j.ogm.exception.CypherException: Error executing Cypher; Code: Neo.ClientError.Statement.EntityNotFound; Description: Unable to load NODE with id 2157. 
    at org.neo4j.ogm.drivers.embedded.request.EmbeddedRequest.executeRequest(EmbeddedRequest.java:176) 
    at org.neo4j.ogm.drivers.embedded.request.EmbeddedRequest.execute(EmbeddedRequest.java:144) 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:93) 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:73) 
    at org.neo4j.ogm.session.Neo4jSession.query(Neo4jSession.java:313) 
    at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:61) 
    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.$Proxy125.deleteDecisions(Unknown Source) 

idが2157のNODEはVoteGroupエンティティです。

これが私のエンティティである:私のクエリが間違っている

@NodeEntity 
public class VoteGroup extends BaseEntity { 

    private static final String VOTED_ON = "VOTED_ON"; 
    private final static String VOTED_FOR = "VOTED_FOR"; 
    private final static String CONTAINS = "CONTAINS"; 

    @Relationship(type = VOTED_FOR, direction = Relationship.OUTGOING) 
    private Decision decision; 

    @Relationship(type = VOTED_ON, direction = Relationship.OUTGOING) 
    private Criterion criterion; 

    @Relationship(type = CONTAINS, direction = Relationship.OUTGOING) 
    private Set<Vote> votes = new HashSet<>(); 

    private double avgVotesWeight; 

    private long totalVotesCount; 

    public VoteGroup() { 
    } 

    public VoteGroup(Decision decision, Criterion criterion, double avgVotesWeight, long totalVotesCount) { 
     this.decision = decision; 
     decision.addVoteGroup(this); 
     this.criterion = criterion; 
     criterion.addVoteGroup(this); 
     this.avgVotesWeight = avgVotesWeight; 
     this.totalVotesCount = totalVotesCount; 
    } 
... 
} 

@NodeEntity 
public class Vote extends Authorable { 

    private final static String CONTAINS = "CONTAINS"; 

    @Relationship(type = CONTAINS, direction = Relationship.INCOMING) 
    private VoteGroup group; 

    private double weight; 

    private String description; 

    public Vote() { 
    } 

    public Vote(VoteGroup group, User author, double weight, String description) { 
     this.group = group; 
     group.addVote(this); 
     setAuthor(author); 
     this.weight = weight; 
     this.description = description; 
    } 
... 
} 

何?

enter image description here

enter image description here

答えて

1

これはのNeo4jの問題のように見える、でそれをログインしてください:私は同じ結果とスタンドアロンのNeo4jサーバーでもこれを試してみました

を更新し

https://github.com/neo4j/neo4j/issues、EXPLAIN計画とエラーメッセージが表示されます。ところで

、あなたが早期にコメントを削除して、最後にそれらすべてを行うをドロップすると、あなたが先に動くことができる必要があります:

MATCH (d:Decision) WHERE id(d) IN [155, 163, 144] 
OPTIONAL MATCH (d)<-[:COMMENTED_ON*]-(com:Comment) 
OPTIONAL MATCH (d)<-[:DEFINED_BY]-(c) 
OPTIONAL MATCH (c)<-[:VOTED_ON]-(vg) 
OPTIONAL MATCH (vg)-[:CONTAINS]->(v) 
DETACH DELETE v, vg, c, d,com 
0

私はのためであった正確に同じ問題を抱えていました "neo4j-ogm-embedded-driver"バージョン私は自分のポームで使用しました。 私は誤って2.0.5でデフォルト(2.0.3)で使用されているバージョン "spring-data-neo4j" を上書きしました。そして、これは記載された問題 につながります..

関連する問題