public OUpdateOperations copy() { OUpdateOperations result = new OUpdateOperations(-1); result.type = type; result.updateItems = updateItems == null ? null : updateItems.stream().map(x -> x.copy()).collect(Collectors.toList()); result.updatePutItems = updatePutItems == null ? null : updatePutItems.stream().map(x -> x.copy()).collect(Collectors.toList()); result.json = json == null ? null : json.copy(); result.updateIncrementItems = updateIncrementItems == null ? null : updateIncrementItems.stream().map(x -> x.copy()).collect(Collectors.toList()); result.updateRemoveItems = updateRemoveItems == null ? null : updateRemoveItems.stream().map(x -> x.copy()).collect(Collectors.toList()); return result; }
@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 boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OMoveVertexStatement that = (OMoveVertexStatement) o; if (!source.equals(that.source)) return false; if (targetCluster != null ? !targetCluster.equals(that.targetCluster) : that.targetCluster != null) return false; if (targetClass != null ? !targetClass.equals(that.targetClass) : that.targetClass != null) return false; if (updateOperations != null ? !updateOperations.equals(that.updateOperations) : that.updateOperations != null) return false; return batch != null ? batch.equals(that.batch) : that.batch == null; }
private void handleOperations(OUpdateExecutionPlan plan, OCommandContext ctx, OUpdateOperations op, boolean profilingEnabled) { if (op != null) { switch (op.getType()) { case OUpdateOperations.TYPE_SET: plan.chain(new UpdateSetStep(op.getUpdateItems(), ctx, profilingEnabled)); break; case OUpdateOperations.TYPE_REMOVE: plan.chain(new UpdateRemoveStep(op.getUpdateRemoveItems(), ctx, profilingEnabled)); break; case OUpdateOperations.TYPE_MERGE: plan.chain(new UpdateMergeStep(op.getJson(), ctx, profilingEnabled)); break; case OUpdateOperations.TYPE_CONTENT: plan.chain(new UpdateContentStep(op.getJson(), ctx, profilingEnabled)); break; case OUpdateOperations.TYPE_PUT: case OUpdateOperations.TYPE_INCREMENT: case OUpdateOperations.TYPE_ADD: throw new OCommandExecutionException("Cannot execute with UPDATE PUT/ADD/INCREMENT new executor: " + op); } } }
final public OUpdateOperations UpdateOperations() throws ParseException { OUpdateOperations jjtn000 = new OUpdateOperations(JJTUPDATEOPERATIONS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));OUpdateItem lastItem; OUpdatePutItem lastPutItem; OUpdateIncrementItem lastIncrementItem; jjtn000.jjtSetLastToken(getToken(0)); {if (true) return jjtn000;} } catch (Throwable jjte000) { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0));
@Override public int hashCode() { int result = source.hashCode(); result = 31 * result + (targetCluster != null ? targetCluster.hashCode() : 0); result = 31 * result + (targetClass != null ? targetClass.hashCode() : 0); result = 31 * result + (updateOperations != null ? updateOperations.hashCode() : 0); result = 31 * result + (batch != null ? batch.hashCode() : 0); return result; }
private void handleOperations(OUpdateExecutionPlan plan, OCommandContext ctx, List<OUpdateOperations> ops, boolean profilingEnabled) { if (ops != null) { for (OUpdateOperations op : ops) { switch (op.getType()) { case OUpdateOperations.TYPE_SET: plan.chain(new UpdateSetStep(op.getUpdateItems(), ctx, profilingEnabled)); if(updateEdge){ plan.chain(new UpdateEdgePointersStep( ctx, profilingEnabled)); } break; case OUpdateOperations.TYPE_REMOVE: plan.chain(new UpdateRemoveStep(op.getUpdateRemoveItems(), ctx, profilingEnabled)); break; case OUpdateOperations.TYPE_MERGE: plan.chain(new UpdateMergeStep(op.getJson(), ctx, profilingEnabled)); break; case OUpdateOperations.TYPE_CONTENT: plan.chain(new UpdateContentStep(op.getJson(), ctx, profilingEnabled)); break; case OUpdateOperations.TYPE_PUT: case OUpdateOperations.TYPE_INCREMENT: case OUpdateOperations.TYPE_ADD: throw new OCommandExecutionException("Cannot execute with UPDATE PUT/ADD/INCREMENT new executor: " + op); } } } }
@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(); }