Examples of OCommandSQLParsingException


Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

    throw new OCommandSQLParsingException(iText + ". Use " + syntax, parserText, parserGetPreviousPosition());
  }

  public OSQLPredicate text(final String iText) {
    if (iText == null)
      throw new OCommandSQLParsingException("Query text is null");

    try {
      parserText = iText;
      parserTextUpperCase = parserText.toUpperCase(Locale.ENGLISH);
      parserSetCurrentPosition(0);
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

            // PUT THE RESULT INTO THE CONTEXT
            getContext().setVariable(variable, lastResult);
          } else if (lastCommand.equalsIgnoreCase("begin")) {

            if (txBegun)
              throw new OCommandSQLParsingException("Transaction already begun");

            txBegun = true;
            txBegunAtLine = line;
            txBegunAtPart = linePart;

            db.begin();

          } else if (lastCommand.equalsIgnoreCase("rollback")) {

            if (!txBegun)
              throw new OCommandSQLParsingException("Transaction not begun");

            db.rollback();

            txBegun = false;
            txBegunAtLine = -1;
            txBegunAtPart = -1;

          } else if (OStringSerializerHelper.startsWithIgnoreCase(lastCommand, "commit")) {
            if (txBegunAtLine < 0)
              throw new OCommandSQLParsingException("Transaction not begun");

            if (lastCommand.length() > "commit ".length()) {
              String next = lastCommand.substring("commit ".length()).trim();
              if (OStringSerializerHelper.startsWithIgnoreCase(next, "retry ")) {
                next = next.substring("retry ".length()).trim();
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

    final List<String> funcParamsText = OStringSerializerHelper.getParameters(iText);

    method = OSQLEngine.getInstance().getMethod(funcName);
    if (method == null)
      throw new OCommandSQLParsingException("Unknown method " + funcName + "()");

    // PARSE PARAMETERS
    this.configuredParameters = new Object[funcParamsText.size()];
    for (int i = 0; i < funcParamsText.size(); ++i)
      this.configuredParameters[i] = funcParamsText.get(i);
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

        parseRetry();
      } else if (temp.length() > 0) {
        // GET/CHECK CLASS NAME
        clazz = graph.getEdgeType(temp);
        if (clazz == null)
          throw new OCommandSQLParsingException("Class '" + temp + " was not found");
      }

      temp = parseOptionalWord(true);
      if (parserIsEnded())
        break;
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

      className = "V";

    // GET/CHECK CLASS NAME
    clazz = database.getMetadata().getSchema().getClass(className);
    if (clazz == null)
      throw new OCommandSQLParsingException("Class " + className + " was not found");

    return this;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

    parserRequiredKeyword("MOVE");
    parserRequiredKeyword("VERTEX");

    source = parserRequiredWord(false, "Syntax error", " =><,\r\n");
    if (source == null)
      throw new OCommandSQLParsingException("Cannot find source");

    parserRequiredKeyword("TO");

    String temp = parseOptionalWord(true);

    while (temp != null) {
      if (temp.startsWith("CLUSTER:")) {
        if (className != null)
          throw new OCommandSQLParsingException("Cannot define multiple sources. Found both cluster and class.");

        clusterName = temp.substring("CLUSTER:".length());
        if (database.getClusterIdByName(clusterName) == -1)
          throw new OCommandSQLParsingException("Cluster '" + clusterName + "' was not found");

      } else if (temp.startsWith("CLASS:")) {
        if (clusterName != null)
          throw new OCommandSQLParsingException("Cannot define multiple sources. Found both cluster and class.");

        className = temp.substring("CLASS:".length());

        if (!database.getMetadata().getSchema().existsClass(className))
          throw new OCommandSQLParsingException("Class " + className + " was not found");

      } else if (temp.equals(KEYWORD_SET)) {
        fields = new LinkedHashMap<String, Object>();
        parseSetFields(fields);
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

      className = "E";

    // GET/CHECK CLASS NAME
    clazz = database.getMetadata().getSchema().getClass(className);
    if (clazz == null)
      throw new OCommandSQLParsingException("Class " + className + " was not found");

    return this;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.OCommandSQLParsingException

      } else if (word.length() > 0) {
        // GET/CHECK CLASS NAME
        clazz = database.getMetadata().getSchema().getClass(word);
        if (clazz == null)
          throw new OCommandSQLParsingException("Class '" + word + " was not found");
      }

      word = parseOptionalWord(true);
      if (parserIsEnded())
        break;
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.