public ODeleteExecutionPlan createExecutionPlan(OCommandContext ctx, boolean enableProfiling) { ODeleteExecutionPlan result = new ODeleteExecutionPlan(ctx); if (handleIndexAsTarget(result, fromClause.getItem().getIndex(), whereClause, ctx)) { if (limit != null) { throw new OCommandExecutionException("Cannot apply a LIMIT on a delete from index"); } if (returnBefore) { throw new OCommandExecutionException("Cannot apply a RETURN BEFORE on a delete from index"); } } else { handleTarget(result, ctx, this.fromClause, this.whereClause, enableProfiling); handleLimit(result, ctx, this.limit, enableProfiling); } handleCastToVertex(result, ctx, enableProfiling); handleDelete(result, ctx, enableProfiling); handleReturn(result, ctx, this.returnBefore, enableProfiling); return result; }
public ODeleteExecutionPlan createExecutionPlan(OCommandContext ctx, boolean enableProfiling) { ODeleteExecutionPlan result = new ODeleteExecutionPlan(ctx); if (handleIndexAsTarget(result, fromClause.getItem().getIndex(), whereClause, ctx,enableProfiling)) { if (limit != null) { throw new OCommandExecutionException("Cannot apply a LIMIT on a delete from index"); } if (unsafe) { throw new OCommandExecutionException("Cannot apply a UNSAFE on a delete from index"); } if (returnBefore) { throw new OCommandExecutionException("Cannot apply a RETURN BEFORE on a delete from index"); } handleReturn(result, ctx, this.returnBefore, enableProfiling); } else { handleTarget(result, ctx, this.fromClause, this.whereClause, enableProfiling); handleUnsafe(result, ctx, this.unsafe, enableProfiling); handleLimit(result, ctx, this.limit, enableProfiling); handleDelete(result, ctx, enableProfiling); handleReturn(result, ctx, this.returnBefore, enableProfiling); } return result; }
public ODeleteExecutionPlan createExecutionPlan(OCommandContext ctx, boolean enableProfiling) { ODeleteExecutionPlan result = new ODeleteExecutionPlan(ctx); if (leftExpression != null || rightExpression != null) { handleGlobalLet(result, new OIdentifier("$__ORIENT_DELETE_EDGE_fromV"), leftExpression, ctx, enableProfiling); handleGlobalLet(result, new OIdentifier("$__ORIENT_DELETE_EDGE_toV"), rightExpression, ctx, enableProfiling); handleFetchFromTo(result, ctx, "$__ORIENT_DELETE_EDGE_fromV", "$__ORIENT_DELETE_EDGE_toV", className, targetClusterName, enableProfiling); handleWhere(result, ctx, whereClause, enableProfiling); } else if (whereClause != null) { OFromClause fromClause = new OFromClause(-1); OFromItem item = new OFromItem(-1); if (className == null) { item.setIdentifier(new OIdentifier("E")); } else { item.setIdentifier(className); } fromClause.setItem(item); handleTarget(result, ctx, fromClause, this.whereClause, enableProfiling); } else { handleTargetClass(result, ctx, className, enableProfiling); handleTargetCluster(result, ctx, targetClusterName, enableProfiling); handleTargetRids(result, ctx, rids, enableProfiling); } handleLimit(result, ctx, this.limit, enableProfiling); handleCastToEdge(result, ctx, enableProfiling); handleDelete(result, ctx, enableProfiling); handleReturn(result, ctx, enableProfiling); return result; }