Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.OSchemaException


    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_DELETE);

    final OProperty prop = properties.remove(iPropertyName.toLowerCase());

    if (prop == null)
      throw new OSchemaException("Property '" + iPropertyName + "' not found in class " + name + "'");

    prop.dropIndex();

    fixedSize -= prop.getType().size;
  }
View Full Code Here


    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);

    final String lowerName = iPropertyName.toLowerCase();

    if (properties.containsKey(lowerName))
      throw new OSchemaException("Class " + name + " already has the property '" + iPropertyName + "'");

    final StringBuilder cmd = new StringBuilder("create property ");
    // CLASS.PROPERTY NAME
    cmd.append(name);
    cmd.append('.');
View Full Code Here

    }
  }

  public OPropertyImpl addPropertyInternal(final String iName, final OType iType, final OType iLinkedType, final OClass iLinkedClass) {
    if (iName == null || iName.length() == 0)
      throw new OSchemaException("Found property name null");

    final Character wrongCharacter = OSchemaShared.checkNameIfValid(iName);
    if (wrongCharacter != null)
      throw new OSchemaException("Found invalid property name. Character '" + wrongCharacter + "' can't be used in property name.");

    final String lowerName = iName.toLowerCase();

    if (properties.containsKey(lowerName))
      throw new OSchemaException("Class " + name + " already has the property '" + iName + "'");

    final OPropertyImpl prop = new OPropertyImpl(this, iName, iType);

    properties.put(lowerName, prop);
    fixedSize += iType.size;
View Full Code Here

  private void checkForDateFormat(String min) {
    if (type == OType.DATE) {
      try {
        owner.owner.getDocument().getDatabase().getStorage().getConfiguration().getDateTimeFormatInstance().parse(min);
      } catch (ParseException e) {
        throw new OSchemaException("Invalid date format setted", e);
      }
    }
  }
View Full Code Here

    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_CREATE);

    final String key = iClassName.toLowerCase();

    if (classes.containsKey(key))
      throw new OSchemaException("Class " + iClassName + " already exists in current database");

    final OClass cls = new OClass(this, classes.size(), iClassName, iClusterIds, iDefaultClusterId);
    classes.put(key, cls);
    document.setDirty();
View Full Code Here

    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_DELETE);

    final String key = iClassName.toLowerCase();

    if (!classes.containsKey(key))
      throw new OSchemaException("Class " + iClassName + " was not found in current database");

    classes.remove(key);
    document.setDirty();
  }
View Full Code Here

    for (OClass c : classes.values())
      if (c.getId() == iClassId)
        return c;

    throw new OSchemaException("Class #" + iClassId + " was not found in current database");
  }
View Full Code Here

  public OProperty createProperty(final String iPropertyName, final OType iType, final OClass iLinkedClass) {
    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);

    if (iLinkedClass == null)
      throw new OSchemaException("Missed linked class");

    final OProperty prop = addProperty(iPropertyName, iType, fixedSize);
    prop.setLinkedClass(iLinkedClass);
    return prop;
  }
View Full Code Here

    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);

    final OProperty prop = properties.remove(iPropertyName.toLowerCase());

    if (prop == null)
      throw new OSchemaException("Property '" + iPropertyName + "' not found in class " + name + "'");

    prop.removeIndex();

    fixedSize -= prop.getType().size;
    setDirty();
View Full Code Here

    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);

    final String lowerName = iName.toLowerCase();

    if (properties.containsKey(lowerName))
      throw new OSchemaException("Class " + name + " already has the property '" + iName + "'");

    final OProperty prop = new OProperty(this, iName, iType, iOffset);

    properties.put(lowerName, prop);
    fixedSize += iType.size;
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.OSchemaException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.