Created
May 2, 2012 12:20
-
-
Save danielpcox/2576193 to your computer and use it in GitHub Desktop.
Neo4j java-rest-binding bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SandboxApp | |
{ | |
private static Node node1; | |
private static RelationshipType relType = DynamicRelationshipType.withName("BEHOLD"); | |
public static void main( String[] args ) throws ParseException, JSONException | |
{ | |
RestAPI restAPI = new RestAPI("http://localhost:7474/db/data"); | |
node1 = restAPI.createNode(map()); | |
restAPI.executeBatch(new BatchCallback<Void>() { | |
@Override | |
public Void recordBatch(RestAPI batchRestApi) { | |
Node node2 = batchRestApi.createNode(map()); | |
// Throws RuntimeException from RestAPI.java, line 135: | |
node1.createRelationshipTo(node2, relType); | |
// WORKAROUND - the following succeeds: | |
// (new RestNode(((RestNode)node1).getUri(), batchRestApi)).createRelationshipTo(node2, relType); | |
return null; | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment