use of org.neo4j.storageengine.api.RelationshipItem in project neo4j by neo4j.
the class NeoStoresTest method relAddProperty.
private DefinedProperty relAddProperty(long relationshipId, int key, Object value) {
DefinedProperty property = Property.property(key, value);
Property oldProperty = Property.noRelationshipProperty(relationshipId, key);
try (StorageStatement statement = storeLayer.newStatement();
Cursor<RelationshipItem> cursor = statement.acquireSingleRelationshipCursor(relationshipId)) {
if (cursor.next()) {
Property fetched = getProperty(key, statement, cursor.get().nextPropertyId());
if (fetched != null) {
oldProperty = fetched;
}
}
}
transaction.relationshipDoReplaceProperty(relationshipId, oldProperty, property);
return property;
}
Aggregations