Normunds Kalnberzins
Normunds Kalnberzins

Reputation: 1245

how can I link edge collection to the graph in Arangodb using a Java driver

The only way I find it is working is when I provide the definition at the graph creation time using:

  GraphEntity graph = driver.createGraph(graphName, edgeDefinitions, orphans, bWait);

If I try something like:

  GraphEntity graph = driver.createGraph(graphName, bWait);
  graph.setEdgeDefinitions(edgeDefinitions);

it ignores the modified value and when actually trying to create an edge returns:

  com.arangodb.ArangoException: [1203]collection not found

When creating a new graph it does not matter much, but when I try at some point to add a new edge collection to the existing graph, it becomes a problem.

Also - in Java (driver) I find no way to add edges directly to the edge collection, only via graph (unless I use my own REST calls) Is it by design?

Upvotes: 1

Views: 315

Answers (1)

Floyd
Floyd

Reputation: 401

1st: This is a bug. graph.setEdgeDefinitions(edgeDefinitions) does not persist. So creating an edge leads to an exception. Will be fixed asap.

2nd: Unfortunately the createEdge() method was moved to the graph module, without regarding the need, to add edges directly. Will be fixed too...

It would be great if you could add 2 Issues to https://github.com/arangodb/arangodb-java-driver/issues they will be fixed asap.

Upvotes: 1

Related Questions