use of org.neo4j.kernel.api.TokenWriteOperations in project neo4j by neo4j.
the class IndexIT method createLabelAndProperty.
@Before
public void createLabelAndProperty() throws Exception {
TokenWriteOperations tokenWrites = tokenWriteOperationsInNewTransaction();
labelId = tokenWrites.labelGetOrCreateForName(LABEL);
propertyKeyId = tokenWrites.propertyKeyGetOrCreateForName(PROPERTY_KEY);
descriptor = new NodePropertyDescriptor(labelId, propertyKeyId);
commit();
}
use of org.neo4j.kernel.api.TokenWriteOperations in project neo4j by neo4j.
the class NodeGetUniqueFromIndexSeekIT method createKeys.
@Before
public void createKeys() throws Exception {
TokenWriteOperations tokenWriteOperations = tokenWriteOperationsInNewTransaction();
this.labelId = tokenWriteOperations.labelGetOrCreateForName("Person");
this.propertyId1 = tokenWriteOperations.propertyKeyGetOrCreateForName("foo");
this.propertyId2 = tokenWriteOperations.propertyKeyGetOrCreateForName("bar");
commit();
}
use of org.neo4j.kernel.api.TokenWriteOperations in project neo4j by neo4j.
the class AbstractConstraintCreationIT method createKeys.
@Before
public void createKeys() throws Exception {
TokenWriteOperations tokenWriteOperations = tokenWriteOperationsInNewTransaction();
this.typeId = initializeLabelOrRelType(tokenWriteOperations, KEY);
this.propertyKeyId = tokenWriteOperations.propertyKeyGetOrCreateForName(PROP);
this.descriptor = makeDescriptor(typeId, propertyKeyId);
commit();
}
use of org.neo4j.kernel.api.TokenWriteOperations in project neo4j by neo4j.
the class BuiltInProceduresIT method listPropertyKeys.
@Test
public void listPropertyKeys() throws Throwable {
// Given
TokenWriteOperations ops = tokenWriteOperationsInNewTransaction();
ops.propertyKeyGetOrCreateForName("MyProp");
commit();
// When
RawIterator<Object[], ProcedureException> stream = procedureCallOpsInNewTx().procedureCallRead(procedureName("db", "propertyKeys"), new Object[0]);
// Then
assertThat(asList(stream), contains(equalTo(new Object[] { "MyProp" })));
}
use of org.neo4j.kernel.api.TokenWriteOperations in project neo4j by neo4j.
the class UniquenessConstraintValidationIT method createConstraint.
private void createConstraint(String label, String propertyKey) throws KernelException {
//TODO: Consider testing composite indexes
int labelId, propertyKeyId;
TokenWriteOperations tokenWriteOperations = tokenWriteOperationsInNewTransaction();
labelId = tokenWriteOperations.labelGetOrCreateForName(label);
propertyKeyId = tokenWriteOperations.propertyKeyGetOrCreateForName(propertyKey);
commit();
SchemaWriteOperations schemaWriteOperations = schemaWriteOperationsInNewTransaction();
schemaWriteOperations.uniquePropertyConstraintCreate(forLabel(labelId, propertyKeyId));
commit();
}
Aggregations