Examples of OCommandExecutionException


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

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

    for (String rec : records) {
      try {
        final ORecordId rid = new ORecordId(rec);
        database.getStorage().deleteRecord(rid, -1);
      } catch (Throwable e) {
        throw new OCommandExecutionException("Error on executing command", e);
      }
    }

    return records.size();
  }
View Full Code Here

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

  /**
   * 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 database.getMetadata().getSchema().getClasses().size();
View Full Code Here

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

  /**
   * Execute the ALTER PROPERTY.
   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (attribute == 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");

    final OPropertyImpl prop = (OPropertyImpl) sourceClass.getProperty(fieldName);
    if (prop == null)
      throw new OCommandExecutionException("Property '" + className + "." + fieldName + "' not exists");

    prop.setInternalAndSave(attribute, value);
    return null;
  }
View Full Code Here

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

    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

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

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

  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

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

  }

  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

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

   */
  public Object command(final OCommandRequestText iCommand) {
    checkConnection();

    if (!(iCommand instanceof OSerializableStream))
      throw new OCommandExecutionException("Can't serialize the command to being executed to the server side.");

    OSerializableStream command = iCommand;
    Object result = null;

    do {
View Full Code Here

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

   */
  public Object command(final OCommandRequestText iCommand) {
    checkConnection();

    if (!(iCommand instanceof OSerializableStream))
      throw new OCommandExecutionException("Can't serialize the command to being executed to the server side.");

    OSerializableStream command = iCommand;

    Object result = null;

View Full Code Here

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

   */
  public Object command(final OCommandRequestText iCommand) {
    checkConnection();

    if (!(iCommand instanceof OSerializableStream))
      throw new OCommandExecutionException("Can't serialize the command to being executed to the server side.");

    OSerializableStream command = iCommand;

    Object result = null;

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.