Package com.orientechnologies.orient.core.exception

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


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

    Set<ORID> result = new HashSet<ORID>();
    if (classList == null || classList.equals("")) {
      for (String clusterName : database.getClusterNames()) {
        browseCluster(clusterName, result);
View Full Code Here


  /**
   * Execute the INSERT and return the ODocument object created.
   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (fieldNames == null)
      throw new OCommandExecutionException("Can't execute the command because it hasn't been parsed yet");

    // CREATE NEW DOCUMENT
    ODocument doc = className != null ? new ODocument(database, className) : new ODocument(database);

    // BIND VALUES
View Full Code Here

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

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

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

View Full Code Here

    return true;
  }

  public List<T> run(final Object... iArgs) {
    if (!(database.getStorage() instanceof OStorageEmbedded))
      throw new OCommandExecutionException("Native queries can run only in embedded-local version. Not in the remote one.");

    queryRecord.setSourceQuery(this);

    // CHECK IF A CLASS WAS CREATED
    OClass cls = database.getMetadata().getSchema().getClass(cluster);
    if (cls == null)
      throw new OCommandExecutionException("Cluster " + cluster + " was not found");

    ((OStorageEmbedded) database.getStorage()).browse(cls.getPolymorphicClusterIds(), null, null, this, record, false);
    return null;
  }
View Full Code Here

      return this;

    T currentRecord = currentValue != null && currentValue instanceof ORecord<?> ? (T) currentValue : record;

    if (iIndex >= currentRecord.size())
      throw new OCommandExecutionException("Column " + iIndex + " not exists. Columns range is: 0-" + (currentRecord.size() - 1));

    currentValue = currentRecord.field(iIndex);
    return this;
  }
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

  /**
   * Execute the INSERT and return the ODocument object created.
   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (fields == null)
      throw new OCommandExecutionException("Can't execute the command because it hasn't been parsed yet");

    if (indexName != null) {
      final OIndex index = database.getMetadata().getIndexManager().getIndex(indexName);
      if (index == null)
        throw new OCommandExecutionException("Target index '" + indexName + "' not found");

      // BIND VALUES
      index.put(fields.get(KEYWORD_KEY), (OIdentifiable) fields.get(KEYWORD_RID));
      return null;
    } else {
View Full Code Here

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

    ((OSchemaProxy) database.getMetadata().getSchema()).dropClassInternal(className);
    ((OSchemaProxy) database.getMetadata().getSchema()).saveInternal();

    return null;
View Full Code Here

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

    if (database.getMetadata().getSchema().existsClass(className))
      throw new OCommandExecutionException("Class " + className + " already exists");

    final OClassImpl sourceClass = (OClassImpl) ((OSchemaProxy) database.getMetadata().getSchema()).createClassInternal(className,
        superClass, clusterIds);
    sourceClass.saveInternal();
    return sourceClass.getId();
View Full Code Here

    final Class<? extends OSQLFunction> f = aggregationFunctions.get(iFunctionName.toUpperCase());
    if (f != null)
      try {
        return f.newInstance();
      } catch (Exception e) {
        throw new OCommandExecutionException("Error in creation of function " + iFunctionName
            + "(). Probably there is not an empty constructor or the constructor generates errors", e);
      }
    return null;
  }
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.