use of org.neo4j.kernel.api.properties.DefinedProperty in project neo4j by neo4j.
the class TransactionToRecordStateVisitor method visitNodePropertyChanges.
@Override
public void visitNodePropertyChanges(long id, Iterator<StorageProperty> added, Iterator<StorageProperty> changed, Iterator<Integer> removed) throws ConstraintValidationException {
while (removed.hasNext()) {
recordState.nodeRemoveProperty(id, removed.next());
}
while (changed.hasNext()) {
DefinedProperty prop = (DefinedProperty) changed.next();
recordState.nodeChangeProperty(id, prop.propertyKeyId(), prop.value());
}
while (added.hasNext()) {
DefinedProperty prop = (DefinedProperty) added.next();
recordState.nodeAddProperty(id, prop.propertyKeyId(), prop.value());
}
}
use of org.neo4j.kernel.api.properties.DefinedProperty in project neo4j by neo4j.
the class TransactionToRecordStateVisitor method visitGraphPropertyChanges.
@Override
public void visitGraphPropertyChanges(Iterator<StorageProperty> added, Iterator<StorageProperty> changed, Iterator<Integer> removed) {
while (removed.hasNext()) {
recordState.graphRemoveProperty(removed.next());
}
while (changed.hasNext()) {
DefinedProperty prop = (DefinedProperty) changed.next();
recordState.graphChangeProperty(prop.propertyKeyId(), prop.value());
}
while (added.hasNext()) {
DefinedProperty prop = (DefinedProperty) added.next();
recordState.graphAddProperty(prop.propertyKeyId(), prop.value());
}
}
use of org.neo4j.kernel.api.properties.DefinedProperty in project neo4j by neo4j.
the class OrderedPropertyValues method toString.
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
String sep = "( ";
for (DefinedProperty property : properties) {
sb.append(sep);
sep = ", ";
sb.append(quote(property.value()));
}
sb.append(" )");
return sb.toString();
}
use of org.neo4j.kernel.api.properties.DefinedProperty in project neo4j by neo4j.
the class StateOperationsAutoIndexingTest method shouldSignalNodePropertyChangedToAutoIndex.
@Test
public void shouldSignalNodePropertyChangedToAutoIndex() throws Exception {
// Given
DefinedProperty property = property(1, "Hello!");
PropertyItem existingProperty = mock(PropertyItem.class);
when(existingProperty.propertyKeyId()).thenReturn(property.propertyKeyId());
when(existingProperty.value()).thenReturn("Goodbye!");
NodeItem node = mock(NodeItem.class);
when(node.labels()).thenReturn(PrimitiveIntCollections.emptySet());
when(storeStmt.acquireSingleNodeCursor(1337)).thenReturn(cursor(node));
when(storeLayer.nodeGetProperty(eq(storeStmt), any(NodeItem.class), eq(property.propertyKeyId()))).thenReturn(cursor(existingProperty));
// When
context.nodeSetProperty(stmt, 1337, property);
// Then
verify(nodeOps).propertyChanged(eq(writeOps), eq(1337L), any(Property.class), eq(property));
}
use of org.neo4j.kernel.api.properties.DefinedProperty in project neo4j by neo4j.
the class StateHandlingStatementOperations method graphRemoveProperty.
@Override
public Property graphRemoveProperty(KernelStatement state, int propertyKeyId) {
Object existingPropertyValue = graphGetProperty(state, propertyKeyId);
if (existingPropertyValue != null) {
DefinedProperty existingProperty = Property.property(propertyKeyId, existingPropertyValue);
state.txState().graphDoRemoveProperty(existingProperty);
return existingProperty;
}
return Property.noGraphProperty(propertyKeyId);
}
Aggregations