public OTraverseProjectionItem copy() { OTraverseProjectionItem result = new OTraverseProjectionItem(-1); result.base = base == null ? null : base.copy(); result.modifier = modifier == null ? null : modifier.copy(); return result; }
public OOrderByItem copy() { OOrderByItem result = new OOrderByItem(); result.alias = alias; result.modifier = modifier == null ? null : modifier.copy(); result.recordAttr = recordAttr; result.rid = rid == null ? null : rid.copy(); result.type = type; result.collate = this.collate == null ? null : collate.copy(); return result; }
public OUpdateIncrementItem copy() { OUpdateIncrementItem result = new OUpdateIncrementItem(-1); result.left = left == null ? null : left.copy(); result.leftModifier = leftModifier == null ? null : leftModifier.copy(); result.right = right == null ? null : right.copy(); return result; }
public OUpdateItem copy() { OUpdateItem result = new OUpdateItem(-1); result.left = left == null ? null : left.copy(); result.leftModifier = leftModifier == null ? null : leftModifier.copy(); result.operator = operator; result.right = right == null ? null : right.copy(); return result; }
@Override public Optional<OUpdateItem> transformToUpdateItem() { if (!checkCanTransformToUpdate()) { return Optional.empty(); } if (operator instanceof OEqualsCompareOperator) { OUpdateItem result = new OUpdateItem(-1); result.operator = OUpdateItem.OPERATOR_EQ; OBaseExpression baseExp = ((OBaseExpression) left.mathExpression); result.left = baseExp.identifier.suffix.identifier.copy(); result.leftModifier = baseExp.modifier == null ? null : baseExp.modifier.copy(); result.right = right.copy(); return Optional.of(result); } return super.transformToUpdateItem(); }
public OFromItem copy() { OFromItem result = new OFromItem(-1); if (rids != null) { result.rids = rids.stream().map(r -> r.copy()).collect(Collectors.toList()); } if (inputParams != null) { result.inputParams = inputParams.stream().map(r -> r.copy()).collect(Collectors.toList()); } result.cluster = cluster == null ? null : cluster.copy(); result.clusterList = clusterList == null ? null : clusterList.copy(); result.index = index == null ? null : index.copy(); result.metadata = metadata == null ? null : metadata.copy(); result.statement = statement == null ? null : statement.copy(); result.inputParam = inputParam == null ? null : inputParam.copy(); result.identifier = identifier == null ? null : identifier.copy(); result.functionCall = functionCall == null ? null : functionCall.copy(); result.modifier = modifier == null ? null : modifier.copy(); return result; }
@Override public OBaseExpression copy() { OBaseExpression result = new OBaseExpression(-1); result.number = number == null ? null : number.copy(); result.identifier = identifier == null ? null : identifier.copy(); result.inputParam = inputParam == null ? null : inputParam.copy(); result.string = string; result.modifier = modifier == null ? null : modifier.copy(); return result; }
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 OModifier copy() { OModifier result = new OModifier(-1); result.squareBrackets = squareBrackets; result.arrayRange = arrayRange == null ? null : arrayRange.copy(); result.condition = condition == null ? null : condition.copy(); result.arraySingleValues = arraySingleValues == null ? null : arraySingleValues.copy(); result.rightBinaryCondition = rightBinaryCondition == null ? null : rightBinaryCondition.copy(); result.methodCall = methodCall == null ? null : methodCall.copy(); result.suffix = suffix == null ? null : suffix.copy(); result.next = next == null ? null : next.copy(); return result; }
private OSelectStatement indexChainToStatement(OModifier modifier, OClass clazz, OExpression right, OCommandContext ctx) { OClass queryClass = clazz; OSelectStatement result = new OSelectStatement(-1); result.target = new OFromClause(-1); result.target.setItem(new OFromItem(-1)); result.target.getItem().identifier = new OIdentifier(queryClass.getName()); result.whereClause = new OWhereClause(-1); OBinaryCondition base = new OBinaryCondition(-1); result.whereClause.baseExpression = new ONotBlock(-1); ((ONotBlock) result.whereClause.baseExpression).sub = base; ((ONotBlock) result.whereClause.baseExpression).negate = false; base.left = new OExpression(-1); base.left.mathExpression = new OBaseExpression(-1); ((OBaseExpression) base.left.mathExpression).identifier = new OBaseIdentifier(modifier.suffix.identifier); ((OBaseExpression) base.left.mathExpression).modifier = modifier.next == null ? null : modifier.next.copy(); base.operator = new OEqualsCompareOperator(-1); base.right = right.copy(); return result; } }