@Override public OUpdateStatement copy() { OUpdateStatement result = null; try { result = getClass().getConstructor(Integer.TYPE).newInstance(-1); } catch (Exception e) { throw new RuntimeException(e); } result.target = target == null ? null : target.copy(); result.operations = operations == null ? null : operations.stream().map(x -> x.copy()).collect(Collectors.toList()); result.upsert = upsert; result.returnBefore = returnBefore; result.returnAfter = returnAfter; result.returnProjection = returnProjection == null ? null : returnProjection.copy(); result.whereClause = whereClause == null ? null : whereClause.copy(); result.lockRecord = lockRecord; result.limit = limit == null ? null : limit.copy(); result.timeout = timeout == null ? null : timeout.copy(); return result; }
@Override public OUpdateEdgeStatement copy() { OUpdateEdgeStatement result = new OUpdateEdgeStatement(-1); result.target = target == null ? null : target.copy(); result.operations = operations == null ? null : operations.stream().map(x -> x.copy()).collect(Collectors.toList()); result.upsert = upsert; result.returnBefore = returnBefore; result.returnAfter = returnAfter; result.returnProjection = returnProjection == null ? null : returnProjection.copy(); result.whereClause = whereClause == null ? null : whereClause.copy(); result.lockRecord = lockRecord; result.limit = limit == null ? null : limit.copy(); result.timeout = timeout == null ? null : timeout.copy(); return result; }
@Override public OMoveVertexStatement copy() { OMoveVertexStatement result = new OMoveVertexStatement(-1); result.source = source.copy(); result.targetClass = targetClass == null ? null : targetClass.copy(); result.targetCluster = targetCluster == null ? null : targetCluster.copy(); result.updateOperations = updateOperations == null ? null : updateOperations.copy(); result.batch = batch == null ? null : batch.copy(); return result; }
public OUpdateExecutionPlanner(OUpdateStatement oUpdateStatement) { if (oUpdateStatement instanceof OUpdateEdgeStatement) { updateEdge = true; } this.target = oUpdateStatement.getTarget().copy(); this.whereClause = oUpdateStatement.getWhereClause() == null ? null : oUpdateStatement.getWhereClause().copy(); this.operations = oUpdateStatement.getOperations() == null ? null : oUpdateStatement.getOperations().stream().map(x -> x.copy()).collect(Collectors.toList()); this.upsert = oUpdateStatement.isUpsert(); this.returnBefore = oUpdateStatement.isReturnBefore(); this.returnAfter = oUpdateStatement.isReturnAfter(); this.returnCount = !(returnAfter || returnBefore); this.returnProjection = oUpdateStatement.getReturnProjection() == null ? null : oUpdateStatement.getReturnProjection().copy(); this.lockRecord = oUpdateStatement.getLockRecord(); this.limit = oUpdateStatement.getLimit() == null ? null : oUpdateStatement.getLimit().copy(); this.timeout = oUpdateStatement.getTimeout() == null ? null : oUpdateStatement.getTimeout().copy(); }