Search in sources :

Example 1 with OSchemaNotCreatedException

use of com.orientechnologies.orient.core.exception.OSchemaNotCreatedException in project orientdb by orientechnologies.

the class OSchemaShared method load.

@Override
public OSchemaShared load() {
    rwSpinLock.acquireWriteLock();
    try {
        if (!new ORecordId(getDatabase().getStorage().getConfiguration().schemaRecordId).isValid())
            throw new OSchemaNotCreatedException("Schema is not created and cannot be loaded");
        ((ORecordId) document.getIdentity()).fromString(getDatabase().getStorage().getConfiguration().schemaRecordId);
        reload("*:-1 index:0");
        snapshot = new OImmutableSchema(this);
        return this;
    } finally {
        rwSpinLock.releaseWriteLock();
    }
}
Also used : OSchemaNotCreatedException(com.orientechnologies.orient.core.exception.OSchemaNotCreatedException) ORecordId(com.orientechnologies.orient.core.id.ORecordId)

Aggregations

OSchemaNotCreatedException (com.orientechnologies.orient.core.exception.OSchemaNotCreatedException)1 ORecordId (com.orientechnologies.orient.core.id.ORecordId)1