use of org.neo4j.internal.kernel.api.TokenRead in project neo4j by neo4j.
the class SchemaImpl method getIndexes.
@Override
public Iterable<IndexDefinition> getIndexes(RelationshipType relationshipType) {
transaction.assertOpen();
TokenRead tokenRead = transaction.tokenRead();
SchemaRead schemaRead = transaction.schemaRead();
List<IndexDefinition> definitions = new ArrayList<>();
int relationshipTypeId = tokenRead.relationshipType(relationshipType.name());
if (relationshipTypeId == TokenRead.NO_TOKEN) {
return emptyList();
}
Iterator<IndexDescriptor> indexes = schemaRead.indexesGetForRelationshipType(relationshipTypeId);
addDefinitions(definitions, tokenRead, IndexDescriptor.sortByType(indexes));
return definitions;
}
use of org.neo4j.internal.kernel.api.TokenRead in project neo4j by neo4j.
the class TransactionImpl method findNodes.
@Override
public ResourceIterator<Node> findNodes(Label label, String key1, Object value1, String key2, Object value2, String key3, Object value3) {
checkLabel(label);
checkPropertyKey(key1);
checkPropertyKey(key2);
checkPropertyKey(key3);
KernelTransaction transaction = kernelTransaction();
TokenRead tokenRead = transaction.tokenRead();
int labelId = tokenRead.nodeLabel(label.name());
return nodesByLabelAndProperties(transaction, labelId, PropertyIndexQuery.exact(tokenRead.propertyKey(key1), Values.of(value1, false)), PropertyIndexQuery.exact(tokenRead.propertyKey(key2), Values.of(value2, false)), PropertyIndexQuery.exact(tokenRead.propertyKey(key3), Values.of(value3, false)));
}
use of org.neo4j.internal.kernel.api.TokenRead in project neo4j by neo4j.
the class TransactionImpl method findNodes.
@Override
public ResourceIterator<Node> findNodes(Label label, Map<String, Object> propertyValues) {
checkLabel(label);
checkArgument(propertyValues != null, "Property values can not be null");
KernelTransaction transaction = kernelTransaction();
TokenRead tokenRead = transaction.tokenRead();
int labelId = tokenRead.nodeLabel(label.name());
PropertyIndexQuery.ExactPredicate[] queries = convertToQueries(propertyValues, tokenRead);
return nodesByLabelAndProperties(transaction, labelId, queries);
}
use of org.neo4j.internal.kernel.api.TokenRead in project neo4j by neo4j.
the class TransactionImpl method findRelationships.
@Override
public ResourceIterator<Relationship> findRelationships(RelationshipType relationshipType, String key, Object value) {
checkRelationshipType(relationshipType);
checkPropertyKey(key);
KernelTransaction transaction = kernelTransaction();
TokenRead tokenRead = transaction.tokenRead();
int labelId = tokenRead.relationshipType(relationshipType.name());
int propertyId = tokenRead.propertyKey(key);
return relationshipsByTypeAndProperty(transaction, labelId, PropertyIndexQuery.exact(propertyId, Values.of(value, false)));
}
use of org.neo4j.internal.kernel.api.TokenRead in project neo4j by neo4j.
the class KernelTransactionSecurityContextTest method shouldAllowTokenReadsInAccessMode.
@Test
void shouldAllowTokenReadsInAccessMode() {
// Given
KernelTransactionImplementation tx = newTransaction(AnonymousContext.access());
// When
TokenRead tokenRead = tx.tokenRead();
// Then
assertNotNull(tokenRead);
}
Aggregations