Skip to content

Commit 78b6fe7

Browse files
committed
fixed GRAPH_EDGES() 2.6-incompatibility
1 parent d73f91f commit 78b6fe7

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/main/java/com/arangodb/ArangoDriver.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5071,7 +5071,7 @@ public <T> EdgeEntity<T> graphUpdateEdge(
50715071
public CursorEntity<PlainEdgeEntity> graphGetEdges(String graphName) throws ArangoException {
50725072

50735073
validateCollectionName(graphName);
5074-
String query = "for i in graph_edges(@graphName, null) return i";
5074+
String query = "for i in graph_edges(@graphName, null, { includeData: true }) return i";
50755075
Map<String, Object> bindVars = new MapBuilder().put("graphName", graphName).get();
50765076

50775077
CursorEntity<PlainEdgeEntity> result = this.executeQuery(query, bindVars, PlainEdgeEntity.class, true, 20);
@@ -5238,7 +5238,7 @@ public <T> CursorEntity<T> graphGetEdges(String graphName, Class<T> clazz, Strin
52385238
throws ArangoException {
52395239

52405240
validateCollectionName(graphName);
5241-
String query = "for i in graph_edges(@graphName, @vertexDocumentHandle) return i";
5241+
String query = "for i in graph_edges(@graphName, @vertexDocumentHandle, { includeData: true }) return i";
52425242
Map<String, Object> bindVars = new MapBuilder().put("graphName", graphName)
52435243
.put("vertexDocumentHandle", vertexDocumentHandle).get();
52445244

@@ -5280,7 +5280,7 @@ public <T> EdgeCursor<T> graphGetEdgeCursorByExample(String graphName, Class<T>
52805280
public <T> CursorEntity<T> graphGetEdgesByExampleObject(String graphName, Class<T> clazz, Object vertexExample)
52815281
throws ArangoException {
52825282
validateCollectionName(graphName);
5283-
String query = "for i in graph_edges(@graphName, @vertexExample) return i";
5283+
String query = "for i in graph_edges(@graphName, @vertexExample, { includeData: true }) return i";
52845284

52855285
Map<String, Object> bindVars = new MapBuilder().put("graphName", graphName).put("vertexExample", vertexExample)
52865286
.get();
@@ -5310,7 +5310,7 @@ public <T> CursorEntity<T> graphGetEdgesByExampleMap(
53105310
Class<T> clazz,
53115311
Map<String, Object> vertexExample) throws ArangoException {
53125312
validateCollectionName(graphName);
5313-
String query = "for i in graph_edges(@graphName, @vertexExample) return i";
5313+
String query = "for i in graph_edges(@graphName, @vertexExample, { includeData: true }) return i";
53145314

53155315
Map<String, Object> bindVars = new MapBuilder().put("graphName", graphName).put("vertexExample", vertexExample)
53165316
.get();
@@ -5320,7 +5320,7 @@ public <T> CursorEntity<T> graphGetEdgesByExampleMap(
53205320
return result;
53215321
}
53225322

5323-
public <V, E> ShortestPathEntity<V, E> graphGetShortesPath(
5323+
public <V, E> ShortestPathEntity<V, E> graphGetShortestPath(
53245324
String graphName,
53255325
Object startVertexExample,
53265326
Object endVertexExample,
@@ -5332,7 +5332,7 @@ public <V, E> ShortestPathEntity<V, E> graphGetShortesPath(
53325332
shortestPathOptions = new ShortestPathOptions();
53335333
}
53345334

5335-
return cursorDriver.getShortesPath(getDefaultDatabase(), graphName, startVertexExample, endVertexExample,
5335+
return cursorDriver.getShortestPath(getDefaultDatabase(), graphName, startVertexExample, endVertexExample,
53365336
shortestPathOptions, getDefaultAqlQueryOptions(), vertexClass, edgeClass);
53375337
}
53385338

src/main/java/com/arangodb/InternalCursorDriver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <T, S extends DocumentEntity<T>> DocumentCursorResult<T, S> executeBaseCursorQue
6969
* @return a ShortestPathEntity object
7070
* @throws ArangoException
7171
*/
72-
public <V, E> ShortestPathEntity<V, E> getShortesPath(
72+
public <V, E> ShortestPathEntity<V, E> getShortestPath(
7373
String database,
7474
String graphName,
7575
Object startVertexExample,

src/main/java/com/arangodb/impl/InternalCursorDriverImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public <T> CursorResult<T> executeAqlQuery(
136136

137137
@SuppressWarnings("unchecked")
138138
@Override
139-
public <V, E> ShortestPathEntity<V, E> getShortesPath(
139+
public <V, E> ShortestPathEntity<V, E> getShortestPath(
140140
String database,
141141
String graphName,
142142
Object startVertexExample,

src/test/java/com/arangodb/ArangoDriverGraphEdgesGetCursorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public void edgesAqlTest() throws ArangoException {
308308
}
309309

310310
@Test
311-
public void shortesPathTest() throws ArangoException {
311+
public void shortestPathTest() throws ArangoException {
312312

313313
TestComplexEntity01 v1 = new TestComplexEntity01("Homer", "A Simpson", 38);
314314
TestComplexEntity01 v2 = new TestComplexEntity01("Marge", "A Simpson", 36);
@@ -323,7 +323,7 @@ public void shortesPathTest() throws ArangoException {
323323
shortestPathOptions.setDirection(Direction.OUTBOUND);
324324

325325
//
326-
ShortestPathEntity<TestComplexEntity01, TestComplexEntity02> entity = driver.graphGetShortesPath(GRAPH_NAME,
326+
ShortestPathEntity<TestComplexEntity01, TestComplexEntity02> entity = driver.graphGetShortestPath(GRAPH_NAME,
327327
vertex1.getDocumentHandle(), vertex2.getDocumentHandle(), shortestPathOptions, TestComplexEntity01.class,
328328
TestComplexEntity02.class);
329329

src/test/java/com/arangodb/example/GraphQueryExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ public static void main(String[] args) {
101101
}
102102

103103
// path A -> F
104-
ShortestPathEntity<Person, Knows> shortestPath = driver.graphGetShortesPath(GRAPH_NAME, new Person("A"),
104+
ShortestPathEntity<Person, Knows> shortestPath = driver.graphGetShortestPath(GRAPH_NAME, new Person("A"),
105105
new Person("F"), new ShortestPathOptions().setDirection(Direction.OUTBOUND), Person.class, Knows.class);
106106

107107
printShortestPath(shortestPath);
108108

109109
// path F -> A (empty result)
110-
shortestPath = driver.graphGetShortesPath(GRAPH_NAME, new Person("F"), new Person("A"),
110+
shortestPath = driver.graphGetShortestPath(GRAPH_NAME, new Person("F"), new Person("A"),
111111
new ShortestPathOptions().setDirection(Direction.OUTBOUND), Person.class, Knows.class);
112112

113113
printShortestPath(shortestPath);

0 commit comments

Comments
 (0)