private void handleSetFields(OInsertExecutionPlan result, OInsertBody insertBody, OCommandContext ctx, boolean profilingEnabled) { if (insertBody == null) { return; } if (insertBody.getIdentifierList() != null) { result.chain(new InsertValuesStep(insertBody.getIdentifierList(), insertBody.getValueExpressions(), ctx, profilingEnabled)); } else if (insertBody.getContent() != null) { result.chain(new UpdateContentStep(insertBody.getContent(), ctx, profilingEnabled)); } else if (insertBody.getContentInputParam() != null) { result.chain(new UpdateContentStep(insertBody.getContentInputParam(), ctx, profilingEnabled)); } else if (insertBody.getSetExpressions() != null) { List<OUpdateItem> items = new ArrayList<>(); for (OInsertSetExpression exp : insertBody.getSetExpressions()) { OUpdateItem item = new OUpdateItem(-1); item.setOperator(OUpdateItem.OPERATOR_EQ); item.setLeft(exp.getLeft().copy()); item.setRight(exp.getRight().copy()); items.add(item); } result.chain(new UpdateSetStep(items, ctx, profilingEnabled)); } }
private void handleSetFields(OInsertExecutionPlan result, OInsertBody insertBody, OCommandContext ctx, boolean profilingEnabled) { if (insertBody == null) { return; } if (insertBody.getIdentifierList() != null) { result.chain(new InsertValuesStep(insertBody.getIdentifierList(), insertBody.getValueExpressions(), ctx, profilingEnabled)); } else if (insertBody.getContent() != null) { result.chain(new UpdateContentStep(insertBody.getContent(), ctx, profilingEnabled)); } else if (insertBody.getContentInputParam() != null) { result.chain(new UpdateContentStep(insertBody.getContentInputParam(), ctx, profilingEnabled)); } else if (insertBody.getSetExpressions() != null) { List<OUpdateItem> items = new ArrayList<>(); for (OInsertSetExpression exp : insertBody.getSetExpressions()) { OUpdateItem item = new OUpdateItem(-1); item.setOperator(OUpdateItem.OPERATOR_EQ); item.setLeft(exp.getLeft().copy()); item.setRight(exp.getRight().copy()); items.add(item); } result.chain(new UpdateSetStep(items, ctx, profilingEnabled)); } }