Skip to content

Commit a782196

Browse files
committed
feat: update tinkerpop query
Signed-off-by: Otavio Santana <[email protected]>
1 parent 1fd83f0 commit a782196

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

jnosql-tinkerpop/src/main/java/org/eclipse/jnosql/databases/tinkerpop/communication/DefaultTinkerpopGraphDatabaseManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ public void remove(CommunicationEntity source, String label, CommunicationEntity
199199
Objects.requireNonNull(label, "label is required");
200200

201201
Vertex sourceVertex = findVertexById(source.find(ID_PROPERTY)
202-
.orElseThrow(() -> new CommunicationException("Source entity must have an ID")))
202+
.orElseThrow(() -> new CommunicationException("Source entity must have an ID")).get())
203203
.orElseThrow(() -> new EmptyResultException("Source entity not found"));
204204

205205
Vertex targetVertex = findVertexById(target.find(ID_PROPERTY)
206-
.orElseThrow(() -> new CommunicationException("Target entity must have an ID")))
206+
.orElseThrow(() -> new CommunicationException("Target entity must have an ID")).get())
207207
.orElseThrow(() -> new EmptyResultException("Target entity not found"));
208208

209209
Iterator<Edge> edges = sourceVertex.edges(Direction.OUT, label);

jnosql-tinkerpop/src/test/java/org/eclipse/jnosql/databases/tinkerpop/communication/DefaultTinkerpopGraphDatabaseManagerTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,11 @@ void shouldRemoveEdge() {
450450
var person1 = entityManager.insert(getEntity());
451451
var person2 = entityManager.insert(getEntity());
452452

453-
entityManager.edge(person1, "FRIEND", person2, Map.of());
453+
CommunicationEdge communicationEdge = entityManager.edge(person1, "FRIEND", person2, Map.of());
454454

455455
entityManager.remove(person1, "FRIEND", person2);
456456

457-
var edgesQuery = select().from(COLLECTION_NAME).where("_id").eq(person1.find("_id").orElseThrow().get()).build();
458-
var edges = entityManager.select(edgesQuery).toList();
457+
var edges = entityManager.findEdgeById(communicationEdge.id());
459458

460459
assertThat(edges).isEmpty();
461460
}

0 commit comments

Comments
 (0)