public Object getValue(OResult iCurrentRecord, Object iResult, OCommandContext ctx) { Object result = null; if (inputParam != null) { result = inputParam.getValue(ctx.getInputParameters()); } else if (expression != null) { result = expression.execute(iCurrentRecord, ctx); } else if (integer != null) { result = integer; } if (result == null) { return null; } if (result instanceof Number) { return ((Number) result).intValue(); } return result; }
public Integer evaluate(OCommandContext ctx) { if (this.num != null) { return num.getValue().intValue(); } else if (inputParam != null) { Object obj = inputParam.getValue(ctx.getInputParameters()); if (obj == null || !(obj instanceof Number)) { throw new OCommandExecutionException("" + obj + " is not a number (BATCH)"); } return ((Number) obj).intValue(); } return -1; }
public Integer getValue(OIdentifiable iCurrentRecord, Object iResult, OCommandContext ctx) { Object result = null; if (inputValue != null) { result = inputValue.getValue(ctx.getInputParameters()); } else if (expressionValue != null) { result = expressionValue.execute(iCurrentRecord, ctx); } else if (integer != null) { result = integer; } if (result == null) { return null; } if (result instanceof Number) { return ((Number) result).intValue(); } return null; }
public Integer getValue(OResult iCurrentRecord, Object iResult, OCommandContext ctx) { Object result = null; if (inputValue != null) { result = inputValue.getValue(ctx.getInputParameters()); } else if (expressionValue != null) { result = expressionValue.execute(iCurrentRecord, ctx); } else if (integer != null) { result = integer; } if (result == null) { return null; } if (result instanceof Number) { return ((Number) result).intValue(); } return null; }
public Integer getValue(OIdentifiable iCurrentRecord, Object iResult, OCommandContext ctx) { Object result = null; if (inputParam != null) { result = inputParam.getValue(ctx.getInputParameters()); } else if (expression != null) { result = expression.execute(iCurrentRecord, ctx); } else if (integer != null) { result = integer; } if (result == null) { return null; } if (result instanceof Number) { return ((Number) result).intValue(); } return null; }
public int getValue(OCommandContext ctx) { if (num != null) { return num.getValue().intValue(); } if (inputParam != null) { Object paramValue = inputParam.getValue(ctx.getInputParameters()); if (paramValue instanceof Number) { return ((Number) paramValue).intValue(); } else { throw new OCommandExecutionException("Invalid value for LIMIT: " + paramValue); } } throw new OCommandExecutionException("No value for LIMIT"); }
public int getValue(OCommandContext ctx) { if (num != null) { return num.getValue().intValue(); } if (inputParam != null) { Object paramValue = inputParam.getValue(ctx.getInputParameters()); if (paramValue instanceof Number) { return ((Number) paramValue).intValue(); } else { throw new OCommandExecutionException("Invalid value for SKIP: " + paramValue); } } throw new OCommandExecutionException("No value for SKIP"); }
public Object evaluateRight(OIdentifiable currentRecord, OCommandContext ctx) { Object rightVal = null; if (rightStatement != null) { rightVal = executeQuery(rightStatement, ctx); } else if (rightParam != null) { rightVal = rightParam.getValue(ctx.getInputParameters()); } else if (rightMathExpression != null) { rightVal = rightMathExpression.execute(currentRecord, ctx); } return rightVal; }
public Object evaluateRight(OResult currentRecord, OCommandContext ctx) { Object rightVal = null; if (rightStatement != null) { rightVal = executeQuery(rightStatement, ctx); } else if (rightParam != null) { rightVal = rightParam.getValue(ctx.getInputParameters()); } else if (rightMathExpression != null) { rightVal = rightMathExpression.execute(currentRecord, ctx); } return rightVal; }
public Object execute(OIdentifiable iCurrentRecord, OCommandContext ctx) { Object result = null; if (number != null) { result = number.getValue(); } else if (identifier != null) { result = identifier.execute(iCurrentRecord, ctx); } else if (string != null && string.length() > 1) { result = OStringSerializerHelper.decode(string.substring(1, string.length() - 1)); } else if (inputParam != null) { result = inputParam.getValue(ctx.getInputParameters()); } if (modifier != null) { result = modifier.execute(iCurrentRecord, result, ctx); } return result; }
public Object execute(OResult iCurrentRecord, OCommandContext ctx) { Object result = null; if (number != null) { result = number.getValue(); } else if (identifier != null) { result = identifier.execute(iCurrentRecord, ctx); } else if (string != null && string.length() > 1) { result = OStringSerializerHelper.decode(string.substring(1, string.length() - 1)); } else if (inputParam != null) { result = inputParam.getValue(ctx.getInputParameters()); } if (modifier != null) { result = modifier.execute(iCurrentRecord, result, ctx); } return result; }
@Override public boolean evaluate(OIdentifiable currentRecord, OCommandContext ctx) { String regex = right; if (regex != null) { regex = regex.substring(1, regex.length() - 1); } else if (rightExpression != null) { Object val = rightExpression.execute(currentRecord, ctx); if (val instanceof String) { regex = (String) val; } else { return false; } } else { Object paramVal = rightParam.getValue(ctx.getInputParameters()); if (paramVal instanceof String) { regex = (String) paramVal; } else { return false; } } Object value = expression.execute(currentRecord, ctx); return matches(value, regex, ctx); }
@Override public boolean evaluate(OResult currentRecord, OCommandContext ctx) { String regex = right; if (regex != null) { regex = regex.substring(1, regex.length() - 1); } else if (rightExpression != null) { Object val = rightExpression.execute(currentRecord, ctx); if (val instanceof String) { regex = (String) val; } else { return false; } } else { Object paramVal = rightParam.getValue(ctx.getInputParameters()); if (paramVal instanceof String) { regex = (String) paramVal; } else { return false; } } Object value = expression.execute(currentRecord, ctx); return matches(value, regex, ctx); }
public void setValue(OResult currentRecord, Object target, Object value, OCommandContext ctx) { Object idx = null; if (this.rid != null) { idx = this.rid.toRecordId(currentRecord, ctx); } else if (inputParam != null) { idx = inputParam.getValue(ctx.getInputParameters()); } else if (expression != null) { idx = expression.execute(currentRecord, ctx); } else if (integer != null) { idx = integer.getValue(); } if (target instanceof Set && idx instanceof Number) { setValue((Set) target, ((Number) idx).intValue(), value, ctx); } else if (target instanceof List && idx instanceof Number) { setValue((List) target, ((Number) idx).intValue(), value, ctx); } else if (target instanceof Map) { setValue((Map) target, idx, value, ctx); } else if (target != null && target.getClass().isArray() && idx instanceof Number) { setArrayValue(target, ((Number) idx).intValue(), value, ctx); } }
@Override public boolean evaluate(OIdentifiable currentRecord, OCommandContext ctx) { Object leftVal = left.execute(currentRecord, ctx); Object rightVal = null; if (rightStatement != null) { rightVal = OInCondition.executeQuery(rightStatement, ctx); } else if (rightParam != null) { rightVal = rightParam.getValue(ctx.getInputParameters()); } else if (rightMathExpression != null) { rightVal = rightMathExpression.execute(currentRecord, ctx); } if (rightVal == null) { return true; } return !OInCondition.evaluateExpression(leftVal, rightVal); }
@Override public boolean evaluate(OResult currentRecord, OCommandContext ctx) { Object leftVal = left.execute(currentRecord, ctx); Object rightVal = null; if (rightStatement != null) { rightVal = OInCondition.executeQuery(rightStatement, ctx); } else if (rightParam != null) { rightVal = rightParam.getValue(ctx.getInputParameters()); } else if (rightMathExpression != null) { rightVal = rightMathExpression.execute(currentRecord, ctx); } if (rightVal == null) { return true; } return !OInCondition.evaluateExpression(leftVal, rightVal); }
doc.merge(json.toDocument(record, ctx), false, false); } else if (inputParameter != null) { Object val = inputParameter.getValue(ctx.getInputParameters()); if (val instanceof OElement) { doc.merge((ODocument) ((OElement) val).getRecord(), false, false);
private void handleInputParamAsTarget(OSelectExecutionPlan result, OInputParameter inputParam, OCommandContext ctx, boolean profilingEnabled) { Object paramValue = inputParam.getValue(ctx.getInputParameters()); if (paramValue == null) { result.chain(new EmptyStep(ctx, profilingEnabled));//nothing to return
private void handleInputParamAsTarget(OSelectExecutionPlan result, Set<String> filterClusters, QueryPlanningInfo info, OInputParameter inputParam, OCommandContext ctx, boolean profilingEnabled) { Object paramValue = inputParam.getValue(ctx.getInputParameters()); if (paramValue == null) { result.chain(new EmptyStep(ctx, profilingEnabled));//nothing to return