Package com.orientechnologies.orient.core.exception

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


    if (commandClass != null)
      try {
        return commandClass.newInstance();
      } catch (Exception e) {
        throw new OCommandExecutionException("Error in creation of command " + commandClass
            + "(). Probably there is not an empty constructor or the constructor generates errors", e);
      }

    return null;
  }
View Full Code Here


  /**
   * Execute the CREATE PROPERTY.
   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (type == null)
      throw new OCommandExecutionException("Can't execute the command because it hasn't been parsed yet");

    final OClassImpl sourceClass = (OClassImpl) database.getMetadata().getSchema().getClass(className);
    if (sourceClass == null)
      throw new OCommandExecutionException("Source class '" + className + "' not found");

    OPropertyImpl prop = (OPropertyImpl) sourceClass.getProperty(fieldName);
    if (prop != null)
      throw new OCommandExecutionException("Property '" + className + "." + fieldName
          + "' already exists. Remove it before to retry.");

    // CREATE THE PROPERTY
    OClass linkedClass = null;
    OType linkedType = null;
View Full Code Here

    super(iQueryToParse, iName);
  }

  public Object getValue(final ORecordInternal<?> iRecord) {
    if (iRecord == null)
      throw new OCommandExecutionException("expression item '" + name + "' can't be resolved");

    final ODatabaseRecord db = iRecord.getDatabase();

    if (name.charAt(0) == '@')
      return transformValue(db, getRecordAttribute(db, iRecord, name));
View Full Code Here

    return this;
  }

  public Object execute(final Map<Object, Object> iArgs) {
    if (subjectName == null)
      throw new OCommandExecutionException("Can't execute the command because it hasn't been parsed yet");

    parameters = iArgs;

    database.query(query, iArgs);
    return recordCount;
View Full Code Here

        if (record.getSchemaClass() != null) {
          final OProperty property = record.getSchemaClass().getProperty(entry.getKey());
          if (property != null
              && (property.getType() != null && (!property.getType().equals(OType.EMBEDDEDMAP) && !property.getType().equals(
                  OType.LINKMAP)))) {
            throw new OCommandExecutionException("field " + entry.getKey() + " is not defined as a map");
          }
        }
        fieldValue = new HashMap();
        record.field(entry.getKey(), fieldValue);
      }
View Full Code Here

  /**
   * Execute the CREATE INDEX.
   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (name == null)
      throw new OCommandExecutionException("Can't execute the command because it hasn't been parsed yet");

    final OIndex idx;
    if (name.indexOf('.') > -1) {
      // PROPERTY INDEX
      final String[] parts = name.split("\\.");
      final String className = parts[0];
      if (className == null)
        throw new OCommandExecutionException("Class " + className + " not found");
      String fieldName = parts[1];

      final OClass cls = database.getMetadata().getSchema().getClass(className);
      if (cls == null)
        throw new OCommandExecutionException("Class '" + className + "' not found");

      final OPropertyImpl prop = (OPropertyImpl) cls.getProperty(fieldName);
      if (prop == null)
        throw new IllegalArgumentException("Property '" + fieldName + "' was not found in class '" + cls + "'");

View Full Code Here

  private void searchInClusters() {
    final int[] clusterIds;
    String firstCluster = compiledFilter.getTargetClusters().keySet().iterator().next();

    if (firstCluster == null || firstCluster.length() == 0)
      throw new OCommandExecutionException("No cluster or schema class selected in query");

    if (Character.isDigit(firstCluster.charAt(0)))
      // GET THE CLUSTER NUMBER
      clusterIds = OStringSerializerHelper.splitIntArray(firstCluster);
    else
View Full Code Here

  }

  private void searchInIndex() {
    final OIndex index = database.getMetadata().getIndexManager().getIndex(compiledFilter.getTargetIndex());
    if (index == null)
      throw new OCommandExecutionException("Target index '" + compiledFilter.getTargetIndex() + "' not found");

    if (compiledFilter.getRootCondition() != null) {
      if (!"KEY".equalsIgnoreCase(compiledFilter.getRootCondition().getLeft().toString()))
        throw new OCommandExecutionException("'Key' field is required for queries against indexes");

      final Object right = compiledFilter.getRootCondition().getRight();
      final Object keyValue = OSQLHelper.getValue(right);

      Collection<OIdentifiable> result = null;
View Full Code Here

      return executor.execute(iCommand.getParameters());
    } catch (OException e) {
      // PASS THROUGHT
      throw e;
    } catch (Exception e) {
      throw new OCommandExecutionException("Error on execution of command: " + iCommand, e);
    }
  }
View Full Code Here

        return coll.toString();
      }

      return result;
    } catch (ScriptException e) {
      throw new OCommandExecutionException("Error on executing GREMLIN command: " + text, e);
    } finally {
      graph.shutdown();
    }
  }
View Full Code Here

TOP

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

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.