Examples of OSQLFunctionRuntime


Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      // NESTED CONDITION: EVALUATE IT RECURSIVELY
      return ((OSQLFilterCondition) iValue).evaluate(iRecord);

    if (iValue instanceof OSQLFunctionRuntime) {
      // STATELESS FUNCTION: EXECUTE IT
      final OSQLFunctionRuntime f = (OSQLFunctionRuntime) iValue;
      return f.execute(iRecord);
    }

    // SIMPLE VALUE: JUST RETURN IT
    return iValue;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      final ODocument result = new ODocument(database);
      for (Entry<String, Object> projection : projections.entrySet()) {
        if (projection.getValue() instanceof OSQLFilterItemField)
          value = ((OSQLFilterItemField) projection.getValue()).getValue(result);
        else if (projection.getValue() instanceof OSQLFunctionRuntime) {
          final OSQLFunctionRuntime f = (OSQLFunctionRuntime) projection.getValue();
          value = f.getResult();
        } else
          value = projection.getValue();

        result.field(projection.getKey(), value);
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      Object value;
      for (Entry<String, Object> projection : projections.entrySet()) {
        if (projection.getValue() instanceof OSQLFilterItemField)
          value = ((OSQLFilterItemField) projection.getValue()).getValue(iRecord);
        else if (projection.getValue() instanceof OSQLFunctionRuntime) {
          final OSQLFunctionRuntime f = (OSQLFunctionRuntime) projection.getValue();
          value = f.execute(iRecord);
        } else
          value = projection.getValue();

        result.field(projection.getKey(), value);
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      for (int i = 0; i < funcParamsText.size(); ++i) {
        funcParams[i] = OSQLHelper.parseValue(database, iCommand, funcParamsText.get(i));
      }

      // FUNCTION: CRETAE A RUN-TIME CONTAINER FOR IT TO SAVE THE PARAMETERS
      return new OSQLFunctionRuntime(function, funcParams);
    }

    return null;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      for (int i = 0; i < funcParamsText.size(); ++i) {
        funcParams[i] = OSQLHelper.parseValue(database, iCommand, funcParamsText.get(i));
      }

      // FUNCTION: CRETAE A RUN-TIME CONTAINER FOR IT TO SAVE THE PARAMETERS
      return new OSQLFunctionRuntime(function, funcParams);
    }

    return null;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      // NESTED CONDITION: EVALUATE IT RECURSIVELY
      return ((OSQLFilterCondition) iValue).evaluate(iRecord);

    if (iValue instanceof OSQLFunctionRuntime) {
      // STATELESS FUNCTION: EXECUTE IT
      final OSQLFunctionRuntime f = (OSQLFunctionRuntime) iValue;
      return f.execute(iRecord);
    }

    // SIMPLE VALUE: JUST RETURN IT
    return iValue;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      Object value;
      for (Entry<String, Object> projection : projections.entrySet()) {
        if (projection.getValue() instanceof OSQLFilterItemField)
          value = ((OSQLFilterItemField) projection.getValue()).getValue(doc);
        else if (projection.getValue() instanceof OSQLFunctionRuntime) {
          final OSQLFunctionRuntime f = (OSQLFunctionRuntime) projection.getValue();
          canExcludeResult = f.filterResult();
          value = f.execute(doc);
        } else
          value = projection.getValue();

        if (value != null)
          result.field(projection.getKey(), value);
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

    }

    if (anyFunctionAggregates) {
      for (Entry<String, Object> projection : projections.entrySet()) {
        if (projection.getValue() instanceof OSQLFunctionRuntime) {
          final OSQLFunctionRuntime f = (OSQLFunctionRuntime) projection.getValue();
          f.setResult(index.getSize());
        }
      }
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      final ODocument result = new ODocument(database).setOrdered(true);
      for (Entry<String, Object> projection : projections.entrySet()) {
        if (projection.getValue() instanceof OSQLFilterItemField)
          value = ((OSQLFilterItemField) projection.getValue()).getValue(result);
        else if (projection.getValue() instanceof OSQLFunctionRuntime) {
          final OSQLFunctionRuntime f = (OSQLFunctionRuntime) projection.getValue();
          value = f.getResult();
        } else
          value = projection.getValue();

        result.field(projection.getKey(), value);
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime

      } else if (function.startsWith("RIGHT(")) {
        final int offset = Integer.parseInt(args.get(0));
        final String stringValue = currentValue.toString();
        result = stringValue.substring(offset < stringValue.length() ? stringValue.length() - offset : 0);
      } else {
        final OSQLFunctionRuntime f = OSQLHelper.getFunction(null, iFunction);
        if (f != null)
          result = f.execute(currentRecord, currentRecord, null, iContext);
      }
    }

    return result;
  }
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.