class Delete extends UpDel {

    public Delete(ServerSession session) {
        super(session);
    }

    @Override
    public int getType() {
        return SQLStatement.DELETE;
    }

    @Override
    public String getPlanSQL() {
        StatementBuilder buff = new StatementBuilder();
        buff.append("DELETE ");
        buff.append("FROM ").append(tableFilter.getPlanSQL(false));
        appendPlanSQL(buff);
        return buff.toString();
    }

    @Override
    public PreparedSQLStatement prepare() {<FILL_FUNCTION_BODY>}

    @Override
    public YieldableBase<Integer> createYieldableUpdate(
            AsyncHandler<AsyncResult<Integer>> asyncHandler) {
        return new YieldableDelete(this, asyncHandler);
    }

    private static class YieldableDelete extends YieldableUpDel {

        public YieldableDelete(Delete statement, AsyncHandler<AsyncResult<Integer>> asyncHandler) {
            super(statement, asyncHandler, statement.tableFilter, statement.limitExpr,
                    statement.condition);
        }

        @Override
        protected int getRightMask() {
            return Right.DELETE;
        }

        @Override
        protected int getTriggerType() {
            return Trigger.DELETE;
        }

        @Override
        protected boolean upDelRow(Row oldRow) {
            boolean done = false;
            if (table.fireRow()) {
                done = table.fireBeforeRow(session, oldRow, null);
            }
            if (!done) {
                removeRow(oldRow);
            }
            return !done;
        }

        private void removeRow(Row row) {
            onPendingOperationStart();
            table.removeRow(session, row, true).onComplete(ar -> {
                if (ar.isSucceeded() && table.fireRow()) {
                    table.fireAfterRow(session, row, null, false);
                }
                onPendingOperationComplete(ar);
            });
        }
    }
}

        if (condition != null) {
            condition.mapColumns(tableFilter, 0);
            condition = condition.optimize(session);
            condition.createIndexConditions(session, tableFilter);
            tableFilter.createColumnIndexes(condition);
        }
        tableFilter.preparePlan(session, 1);
        return this;
    
<methods>public void <init>(com.lealone.db.session.ServerSession) ,public int getPriority() ,public boolean isCacheable() ,public void setCondition(com.lealone.sql.expression.Expression) ,public void setLimit(com.lealone.sql.expression.Expression) ,public void setTableFilter(com.lealone.sql.optimizer.TableFilter) ,public int update() <variables>protected com.lealone.sql.expression.Expression condition,protected com.lealone.sql.expression.Expression limitExpr,protected com.lealone.sql.optimizer.TableFilter tableFilter