use of org.neo4j.storageengine.api.StorageRelationshipScanCursor in project neo4j by neo4j.
the class NeoStoresTest method relDelete.
private void relDelete(long id) {
RelationshipVisitor<RuntimeException> visitor = (relId, type, startNode, endNode) -> transactionState.relationshipDoDelete(relId, type, startNode, endNode);
if (!transactionState.relationshipVisit(id, visitor)) {
try (StorageRelationshipScanCursor cursor = storageReader.allocateRelationshipScanCursor(NULL)) {
cursor.single(id);
if (!cursor.next()) {
throw new RuntimeException("Relationship " + id + " not found");
}
visitor.visit(id, cursor.type(), cursor.sourceNodeReference(), cursor.targetNodeReference());
}
}
}
Aggregations