public OClass setSuperClass(final OClass superClass) {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
acquireSchemaWriteLock();
try {
final ODatabaseRecordInternal database = getDatabase();
final OStorage storage = database.getStorage();
if (storage instanceof OStorageProxy) {
final String cmd = String.format("alter class %s superclass %s", name, superClass != null ? superClass.getName() : null);
database.command(new OCommandSQL(cmd)).execute();
} else if (isDistributedCommand()) {