
package com.jeelowcode.framework.plus.build.buildmodel.dql;

import com.jeelowcode.framework.plus.build.ISQLExpression;
import com.jeelowcode.framework.plus.build.build.dql.BuildDelete;
import com.jeelowcode.framework.plus.build.buildmodel.SqlInfoBaseModel;
import com.jeelowcode.framework.plus.core.model.SqlFormatModel;

public class SqlInfoDeleteModel<T> extends SqlInfoBaseModel {
    private String tableName;

    private Boolean isReal;

    private SqlInfoDeleteModel(){}

    public static Builder builder(){
        return new Builder();
    }


    public static class Builder {

        private SqlInfoDeleteModel sqlInfoDeleteModel = new SqlInfoDeleteModel();

        public Builder setTableName(String tableName) {
            sqlInfoDeleteModel.tableName = tableName;
            sqlInfoDeleteModel.isReal=false;//逻辑删除
            return this;
        }

        public Builder setTableName(String tableName,boolean isReal) {
            sqlInfoDeleteModel.tableName = tableName;
            sqlInfoDeleteModel.isReal=isReal;
            return this;
        }

        public SqlInfoDeleteModel<BuildDelete> build(){
            ISQLExpression<SqlFormatModel> expression = new BuildDelete();
            sqlInfoDeleteModel.setSqlExpression(expression);
            return sqlInfoDeleteModel;
        }
    }

    public String getTableName() {
        return tableName;
    }

    public Boolean getReal() {
        return isReal;
    }
}
