Package com.orientechnologies.orient.core.exception

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


      else if (o instanceof Field)
        return ((Field) o).getType();
      else
        return ((Method) o).getReturnType();
    } catch (Exception e) {
      throw new OSchemaException("Can't get the value of the property: " + iProperty, e);
    }
  }
View Full Code Here


        return ((Method) o).invoke(iPojo);
      else if (o instanceof Field)
        return ((Field) o).get(iPojo);
      return null;
    } catch (Exception e) {
      throw new OSchemaException("Can't get the value of the property: " + iProperty, e);
    }
  }
View Full Code Here

        ((Field) o).set(iPojo, OType.convert(iValue, ((Field) o).getType()));
      }

    } catch (Exception e) {

      throw new OSchemaException("Can't set the value '" + iValue + "' to the property '" + iProperty + "' for the pojo: " + iPojo,
          e);
    }
  }
View Full Code Here

      else
        ((ODatabaseRecord) database.getUnderlying()).save(record, clusterName);
    }

    if (!record.getIdentity().toString().equals(rid))
      throw new OSchemaException("Imported record '" + record.getIdentity() + "' has rid different from the original: " + rid);

    jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);

    return record.getIdentity();
  }
View Full Code Here

    final String key = iClassName.toLowerCase();

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

      final StringBuilder cmd = new StringBuilder("create class ");
      cmd.append(iClassName);

      if (iSuperClass != null) {
View Full Code Here

    }
  }

  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, iClassName, iClusterIds);
      classes.put(key, cls);

      if (cls.getShortName() != null)
View Full Code Here

    lock.acquireExclusiveLock();
    try {

      final OClass cls = classes.get(key);
      if (cls == null)
        throw new OSchemaException("Class " + iClassName + " was not found in current database");

      if (cls.getBaseClasses() != null)
        throw new OSchemaException("Class " + iClassName
            + " can't be dropped since has sub classes. Remove the dependencies before to drop it again");

      final StringBuilder cmd = new StringBuilder("drop class ");
      cmd.append(iClassName);
View Full Code Here

    lock.acquireExclusiveLock();
    try {

      final OClass cls = classes.get(key);
      if (cls == null)
        throw new OSchemaException("Class " + iClassName + " was not found in current database");

      if (cls.getBaseClasses() != null)
        throw new OSchemaException("Class " + iClassName
            + " can't be dropped since has sub classes. Remove the dependencies before to drop it again");

      if (cls.getSuperClass() != null) {
        // REMOVE DEPENDENCY FROM SUPERCLASS
        ((OClassImpl) cls.getSuperClass()).baseClasses.remove(cls);
View Full Code Here

  public void saveInternal() {
    getDatabase();

    if (document.getDatabase().getTransaction().isActive())
      throw new OSchemaException("Can't change the schema while a transaction is active. Schema changes is not transactional");

    lock.acquireExclusiveLock();
    try {

      document.setDirty();
View Full Code Here

    return addProperty(iPropertyName, iType, null, null);
  }

  public OProperty createProperty(final String iPropertyName, final OType iType, final OClass iLinkedClass) {
    if (iLinkedClass == null)
      throw new OSchemaException("Missed linked class");

    return addProperty(iPropertyName, iType, null, iLinkedClass);
  }
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.