public void extractSubQueries(OIdentifier letAlias, SubQueryCollector collector) { if (expression != null) { expression.extractSubQueries(collector); } else if (statement != null) { OIdentifier alias = collector.addStatement(letAlias, statement); statement = null; expression = new OExpression(alias); } }
private static OProjectionItem projectionFromAlias(OIdentifier oIdentifier) { OProjectionItem result = new OProjectionItem(-1); result.setExpression(new OExpression(oIdentifier)); return result; }
public void extractSubQueries(SubQueryCollector collector) { if (expression != null) { expression.extractSubQueries(collector); } else if (statement != null) { OIdentifier alias = collector.addStatement(statement); statement = null; expression = new OExpression(alias); } }
public void deserialize(OResult fromResult) { if (fromResult.getProperty("expressions") != null) { expressions = new ArrayList<>(); List<OResult> ser = fromResult.getProperty("expressions"); for (OResult item : ser) { OExpression exp = new OExpression(-1); exp.deserialize(item); expressions.add(exp); } } }
private OExpression identifierToStringExpr(OIdentifier identifier) { OBaseExpression bexp = new OBaseExpression(identifier.getStringValue()); OExpression result = new OExpression(-1); result.mathExpression = bexp; return result; }
public void deserialize(OResult fromResult) { if (fromResult.getProperty("items") != null) { List<OResult> ser = fromResult.getProperty("items"); items = new ArrayList<>(); for (OResult r : ser) { OExpression exp = new OExpression(-1); exp.deserialize(r); items.add(exp); } } } }
public void deserialize(OResult fromResult) { left = new OExpression(-1); left.deserialize(fromResult.getProperty("left")); try { operator = (OBinaryCompareOperator) Class.forName(String.valueOf(fromResult.getProperty("operator"))).newInstance(); } catch (Exception e) { throw OException.wrapException(new OCommandExecutionException(""), e); } right = new OExpression(-1); right.deserialize(fromResult.getProperty("right")); }
public OUpdateExecutionPlan createExecutionPlan(OCommandContext ctx, boolean enableProfiling) { OForEachExecutionPlan plan = new OForEachExecutionPlan(ctx); int nextProg = ++FOREACH_VARIABLE_PROGR; if (FOREACH_VARIABLE_PROGR < 0) { FOREACH_VARIABLE_PROGR = 0; } OIdentifier varName = new OIdentifier("$__ORIENTDB_FOREACH_VAR_" + nextProg); plan.chain(new GlobalLetExpressionStep(varName, loopValues, ctx, enableProfiling)); plan.chain(new ForEachStep(loopVariable, new OExpression(varName), statements, ctx, enableProfiling)); return plan; }
public void deserialize(OResult fromResult) { try { operator = (OBinaryCompareOperator) Class.forName(String.valueOf(fromResult.getProperty("operator"))).newInstance(); } catch (Exception e) { throw OException.wrapException(new OCommandExecutionException(""), e); } not = fromResult.getProperty("not"); if (Boolean.TRUE.equals(fromResult.getProperty("in"))) { inOperator = new OInOperator(-1); } right = new OExpression(-1); right.deserialize(fromResult.getProperty("right")); } }
public void deserialize(OResult fromResult) { if (fromResult.getProperty("name") != null) { name = OIdentifier.deserialize(fromResult.getProperty("name")); } if (fromResult.getProperty("params") != null) { params = new ArrayList<>(); List<OResult> ser = fromResult.getProperty("params"); for (OResult item : ser) { OExpression exp = new OExpression(-1); exp.deserialize(item); params.add(exp); } } }
public void deserialize(OResult fromResult) { if (fromResult.getProperty("methodName") != null) { methodName = OIdentifier.deserialize(fromResult.getProperty("methodName")); } if (fromResult.getProperty("params") != null) { List<OResult> ser = fromResult.getProperty("params"); params = new ArrayList<>(); for (OResult r : ser) { OExpression exp = new OExpression(-1); exp.deserialize(r); params.add(exp); } } }
public OExpression copy() { OExpression result = new OExpression(-1); result.singleQuotes = singleQuotes; result.doubleQuotes = doubleQuotes; result.isNull = isNull; result.rid = rid == null ? null : rid.copy(); result.mathExpression = mathExpression == null ? null : mathExpression.copy(); result.arrayConcatExpression = arrayConcatExpression == null ? null : arrayConcatExpression.copy(); result.json = json == null ? null : json.copy(); result.booleanValue = booleanValue; return result; }
private OProjectionItem createProjection(OFunctionCall newFunct, OIdentifier alias) { OLevelZeroIdentifier l0 = new OLevelZeroIdentifier(-1); l0.functionCall = newFunct; OBaseIdentifier l1 = new OBaseIdentifier(-1); l1.levelZero = l0; OBaseExpression l2 = new OBaseExpression(-1); l2.identifier = l1; OExpression l3 = new OExpression(-1); l3.mathExpression = l2; OProjectionItem item = new OProjectionItem(-1); item.alias = alias; item.expression = l3; return item; }
private Object calculateNewValue(OResultInternal doc, OCommandContext ctx, OMathExpression.Operator explicitOperator) { OExpression leftEx = new OExpression(left.copy()); if (leftModifier != null) { ((OBaseExpression) leftEx.mathExpression).modifier = leftModifier.copy(); } OMathExpression mathExp = new OMathExpression(-1); mathExp.getChildExpressions().add(leftEx.getMathExpression()); mathExp.getChildExpressions().add(new OParenthesisExpression(right.copy())); mathExp.getOperators().add(explicitOperator); return mathExp.execute(doc, ctx); }
public void deserialize(OResult fromResult) { super.deserialize(fromResult); if (fromResult.getProperty("expression") != null) { expression = new OExpression(-1); expression.deserialize(fromResult.getProperty("expression")); } if (fromResult.getProperty("statement") != null) { statement = OStatement.deserializeFromOResult(fromResult.getProperty("statement")); } }
public void deserialize(OResult fromResult) { if (fromResult.getProperty("leftIdentifier") != null) { leftIdentifier = OIdentifier.deserialize(fromResult.getProperty("leftIdentifier")); } if (fromResult.getProperty("leftString") != null) { leftString = fromResult.getProperty("leftString"); } if (fromResult.getProperty("right") != null) { right = new OExpression(-1); right.deserialize(fromResult.getProperty("right")); } }
public void deserialize(OResult fromResult) { if (fromResult.getProperty("varName") != null) { varName = OIdentifier.deserialize(fromResult.getProperty("varName")); } if (fromResult.getProperty("expression") != null) { expression = new OExpression(-1); expression.deserialize(fromResult.getProperty("expression")); } if (fromResult.getProperty("query") != null) { query = OStatement.deserializeFromOResult(fromResult.getProperty("expression")); } }
@Override public void deserialize(OResult fromResult) { try { OExecutionStepInternal.basicDeserialize(fromResult, this); if (fromResult.getProperty("varname") != null) { varname = OIdentifier.deserialize(fromResult.getProperty("varname")); } if (fromResult.getProperty("expression") != null) { expression = new OExpression(-1); expression.deserialize(fromResult.getProperty("expression")); } reset(); } catch (Exception e) { throw OException.wrapException(new OCommandExecutionException(""), e); } } }
public void deserialize(OResult fromResult) { if (fromResult.getProperty("cluster") != null) { cluster = new OInteger(-1); cluster.deserialize(fromResult.getProperty("cluster")); } if (fromResult.getProperty("position") != null) { position = new OInteger(-1); position.deserialize(fromResult.getProperty("position")); } if (fromResult.getProperty("expression") != null) { expression = new OExpression(-1); expression.deserialize(fromResult.getProperty("expression")); } legacy = fromResult.getProperty("legacy"); } }
public void deserialize(OResult fromResult) { all = fromResult.getProperty("all"); if (fromResult.getProperty("alias") != null) { alias = OIdentifier.deserialize(fromResult.getProperty("alias")); } if (fromResult.getProperty("expression") != null) { expression = new OExpression(-1); expression.deserialize(fromResult.getProperty("expression")); } aggregate = fromResult.getProperty("aggregate"); if (fromResult.getProperty("nestedProjection") != null) { nestedProjection = new ONestedProjection(-1); nestedProjection.deserialize(fromResult.getProperty("nestedProjection")); } }