}
}
public OClass createClassInternal(final String iClassName, final OClass iSuperClass, int[] iClusterIds) {
if (iClassName == null || iClassName.length() == 0)
throw new OSchemaException("Found class name null");
final Character wrongCharacter = checkNameIfValid(iClassName);
if (wrongCharacter != null)
throw new OSchemaException("Found invalid class name. Character '" + wrongCharacter + "' can't be used in class name.");
if (iClusterIds == null || iClusterIds.length == 0)
// CREATE A NEW CLUSTER
iClusterIds = new int[] { getDatabase().addCluster(iClassName, CLUSTER_TYPE.PHYSICAL) };
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_CREATE);
final String key = iClassName.toLowerCase();
lock.acquireExclusiveLock();
try {
if (classes.containsKey(key))
throw new OSchemaException("Class " + iClassName + " already exists in current database");
final OClassImpl cls = new OClassImpl(this, classes.size(), iClassName, iClusterIds);
classes.put(key, cls);
if (cls.getShortName() != null)