use of org.neo4j.kernel.impl.core.TokenNotFoundException in project neo4j by neo4j.
the class InternalAutoIndexOperations method propertyAdded.
@Override
public void propertyAdded(DataWriteOperations ops, long entityId, Property property) throws AutoIndexingKernelException {
if (enabled) {
try {
String name = propertyKeyLookup.getTokenById(property.propertyKeyId()).name();
if (propertyKeysToInclude.get().contains(name)) {
ensureIndexExists(ops);
type.add(ops, entityId, name, property.value());
}
} catch (LegacyIndexNotFoundKernelException | EntityNotFoundException | PropertyNotFoundException e) {
throw new AutoIndexingKernelException(e);
} catch (TokenNotFoundException e) {
// KernelException now
throw new AutoIndexingKernelException(new PropertyKeyIdNotFoundKernelException(property.propertyKeyId(), e));
}
}
}
use of org.neo4j.kernel.impl.core.TokenNotFoundException in project neo4j by neo4j.
the class InternalAutoIndexOperations method propertyRemoved.
@Override
public void propertyRemoved(DataWriteOperations ops, long entityId, int propertyKey) throws AutoIndexingKernelException {
if (enabled) {
try {
String name = propertyKeyLookup.getTokenById(propertyKey).name();
if (propertyKeysToInclude.get().contains(name)) {
ensureIndexExists(ops);
type.remove(ops, entityId, name);
}
} catch (LegacyIndexNotFoundKernelException | EntityNotFoundException e) {
throw new AutoIndexingKernelException(e);
} catch (TokenNotFoundException e) {
// KernelException now
throw new AutoIndexingKernelException(new PropertyKeyIdNotFoundKernelException(propertyKey, e));
}
}
}
use of org.neo4j.kernel.impl.core.TokenNotFoundException in project neo4j by neo4j.
the class InternalAutoIndexOperations method propertyChanged.
@Override
public void propertyChanged(DataWriteOperations ops, long entityId, Property oldProperty, Property newProperty) throws AutoIndexingKernelException {
if (enabled) {
try {
String name = propertyKeyLookup.getTokenById(oldProperty.propertyKeyId()).name();
if (propertyKeysToInclude.get().contains(name)) {
ensureIndexExists(ops);
type.remove(ops, entityId, name, oldProperty.value());
type.add(ops, entityId, name, newProperty.value());
}
} catch (LegacyIndexNotFoundKernelException | EntityNotFoundException | PropertyNotFoundException e) {
throw new AutoIndexingKernelException(e);
} catch (TokenNotFoundException e) {
// KernelException now
throw new AutoIndexingKernelException(new PropertyKeyIdNotFoundKernelException(oldProperty.propertyKeyId(), e));
}
}
}
use of org.neo4j.kernel.impl.core.TokenNotFoundException 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);
}
}
Aggregations