简体   繁体   中英

Spring neo4j cannot add relationships

I am looking at http://spring.io/guides/gs/accessing-data-neo4j/ which runs fine when using an embedded database.

When running against a neo4j server the entities are saved but when trying to add the relationship and saving I'm getting an exception:

java.lang.AbstractMethodError: org.springframework.data.neo4j.rest.SpringRestGraphDatabase.getOrCreateRelationship(Lorg/neo4j/graphdb/Node;Lorg/neo4j/graphdb/Node;Lorg/neo4j/graphdb/RelationshipType;Lorg/neo4j/graphdb/Direction;Ljava/util/Map;)Lorg/neo4j/graphdb/Relationship;

I have no idea why this is being thrown. In addition it appears that this exception is caught and therefore I am unable to roll back the transaction so I can see the entities in the database after the program has run.

The line which causes the error:

personRepository.save(greg); // <-- This saves fine
greg.worksWith(roy); // Add relationship
greg.worksWith(craig); // Add relationship
personRepository.save(greg); // <-- This causes Spring exception

SDN 3 has never been built with remote databases in mind.

Full support for remote databases is delivered by SDN4, the first milestone is available. Read through http://neo4j.com/blog/graphconnect-europe-spring-data-neo4j/ and the linked pages there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM