use of com.orientechnologies.orient.core.sql.functions.OSQLFunctionFiltered in project orientdb by orientechnologies.
the class OMethodCall method execute.
private Object execute(Object targetObjects, OCommandContext ctx, String name, List<OExpression> iParams, Iterable<OIdentifiable> iPossibleResults) {
List<Object> paramValues = new ArrayList<Object>();
for (OExpression expr : iParams) {
paramValues.add(expr.execute((OIdentifiable) ctx.getVariable("$current"), ctx));
}
if (graphMethods.contains(name)) {
OSQLFunction function = OSQLEngine.getInstance().getFunction(name);
if (function instanceof OSQLFunctionFiltered) {
return ((OSQLFunctionFiltered) function).execute(targetObjects, (OIdentifiable) ctx.getVariable("$current"), null, paramValues.toArray(), iPossibleResults, ctx);
} else {
return function.execute(targetObjects, (OIdentifiable) ctx.getVariable("$current"), null, paramValues.toArray(), ctx);
}
}
OSQLMethod method = OSQLEngine.getMethod(name);
if (method != null) {
return method.execute(targetObjects, (OIdentifiable) ctx.getVariable("$current"), ctx, targetObjects, paramValues.toArray());
}
throw new UnsupportedOperationException("OMethod call, something missing in the implementation...?");
}
Aggregations