Search in sources :

Example 1 with RelationshipTypeTokenHolder

use of org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder in project neo4j by neo4j.

the class StorageLayerRelTypesAndDegreeTest method relTypeId.

private int relTypeId(TestRelType type) {
    DependencyResolver resolver = db.getDependencyResolver();
    RelationshipTypeTokenHolder relTypeHolder = resolver.resolveDependency(RelationshipTypeTokenHolder.class);
    int id = relTypeHolder.getIdByName(type.name());
    assertNotEquals(NO_ID, id);
    return id;
}
Also used : RelationshipTypeTokenHolder(org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Example 2 with RelationshipTypeTokenHolder

use of org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder in project neo4j by neo4j.

the class StorageLayerRelTypesAndDegreeTest method relTypeForId.

private TestRelType relTypeForId(int id) {
    DependencyResolver resolver = db.getDependencyResolver();
    RelationshipTypeTokenHolder relTypeHolder = resolver.resolveDependency(RelationshipTypeTokenHolder.class);
    try {
        String typeName = relTypeHolder.getTokenById(id).name();
        return TestRelType.valueOf(typeName);
    } catch (TokenNotFoundException e) {
        throw new RuntimeException(e);
    }
}
Also used : RelationshipTypeTokenHolder(org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder) TokenNotFoundException(org.neo4j.kernel.impl.core.TokenNotFoundException) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Aggregations

DependencyResolver (org.neo4j.graphdb.DependencyResolver)2 RelationshipTypeTokenHolder (org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder)2 TokenNotFoundException (org.neo4j.kernel.impl.core.TokenNotFoundException)1