use of org.neo4j.kernel.impl.core.RelationshipProxy in project neo4j by neo4j.
the class TxStateTransactionDataSnapshot method relationship.
private Relationship relationship(long relId) {
RelationshipProxy relationship = new RelationshipProxy(relationshipActions, relId);
if (!state.relationshipVisit(relId, relationship)) {
// This relationship has been created or changed in this transaction
RelationshipProxy cached = relationshipsReadFromStore.get(relId);
if (cached != null) {
return cached;
}
try {
// Get this relationship data from the store
store.relationshipVisit(relId, relationship);
relationshipsReadFromStore.put(relId, relationship);
} catch (EntityNotFoundException e) {
throw new IllegalStateException("Getting deleted relationship data should have been covered by the tx state");
}
}
return relationship;
}
use of org.neo4j.kernel.impl.core.RelationshipProxy in project neo4j by neo4j.
the class GraphDatabaseFacade method getRelationshipById.
@Override
public Relationship getRelationshipById(long id) {
if (id < 0) {
throw new NotFoundException(format("Relationship %d not found", id), new EntityNotFoundException(EntityType.RELATIONSHIP, id));
}
try (Statement statement = spi.currentStatement()) {
try {
RelationshipProxy relationship = new RelationshipProxy(relActions, id);
statement.readOperations().relationshipVisit(id, relationship);
return relationship;
} catch (EntityNotFoundException e) {
throw new NotFoundException(format("Relationship %d not found", id), e);
}
}
}
Aggregations