public OProjectionItem copy() { OProjectionItem result = new OProjectionItem(-1); result.all = all; result.alias = alias == null ? null : alias.copy(); result.expression = expression == null ? null : expression.copy(); result.nestedProjection = nestedProjection == null ? null : nestedProjection.copy(); result.aggregate = aggregate; return result; }
@Override public ONestedProjectionItem copy() { ONestedProjectionItem result = new ONestedProjectionItem(-1); result.exclude = exclude; result.star = star; result.expression = expression == null ? null : expression.copy(); result.rightWildcard = rightWildcard; result.expansion = expansion == null ? null : expansion.copy(); result.alias = alias == null ? null : alias.copy(); return result; }
@Override public OMatchStatement copy() { OMatchStatement result = new OMatchStatement(-1); result.matchExpressions = matchExpressions == null ? null : matchExpressions.stream().map(x -> x == null ? null : x.copy()).collect(Collectors.toList()); result.notMatchExpressions = notMatchExpressions == null ? null : notMatchExpressions.stream().map(x -> x == null ? null : x.copy()).collect(Collectors.toList()); result.returnItems = returnItems == null ? null : returnItems.stream().map(x -> x == null ? null : x.copy()).collect(Collectors.toList()); result.returnAliases = returnAliases == null ? null : returnAliases.stream().map(x -> x == null ? null : x.copy()).collect(Collectors.toList()); result.returnNestedProjections = returnNestedProjections == null ? null : returnNestedProjections.stream().map(x -> x == null ? null : x.copy()).collect(Collectors.toList()); result.groupBy = groupBy == null ? null : groupBy.copy(); result.orderBy = orderBy == null ? null : orderBy.copy(); result.unwind = unwind == null ? null : unwind.copy(); result.skip = skip == null ? null : skip.copy(); result.limit = limit == null ? null : limit.copy(); result.returnDistinct = this.returnDistinct; result.buildPatterns(); return result; }
public OMatchExecutionPlanner(OMatchStatement stm) { this.matchExpressions = stm.getMatchExpressions().stream().map(x -> x.copy()).collect(Collectors.toList()); this.notMatchExpressions = stm.getNotMatchExpressions().stream().map(x -> x.copy()).collect(Collectors.toList()); this.returnItems = stm.getReturnItems().stream().map(x -> x.copy()).collect(Collectors.toList()); this.returnAliases = stm.getReturnAliases().stream().map(x -> x == null ? null : x.copy()).collect(Collectors.toList()); this.returnNestedProjections = stm.getReturnNestedProjections().stream().map(x -> x == null ? null : x.copy()) .collect(Collectors.toList()); this.limit = stm.getLimit() == null ? null : stm.getLimit().copy(); this.skip = stm.getSkip() == null ? null : stm.getSkip().copy(); this.returnElements = stm.returnsElements(); this.returnPaths = stm.returnsPaths(); this.returnPatterns = stm.returnsPatterns(); this.returnPathElements = stm.returnsPathElements(); this.returnDistinct = stm.isReturnDistinct(); this.groupBy = stm.getGroupBy() == null ? null : stm.getGroupBy().copy(); this.orderBy = stm.getOrderBy() == null ? null : stm.getOrderBy().copy(); this.unwind = stm.getUnwind() == null ? null : stm.getUnwind().copy(); }