
package com.lideeyunji.tool.framework.sql.build.buildmodel.ddl;


import com.lideeyunji.tool.framework.sql.build.ISQLExpression;
import com.lideeyunji.tool.framework.sql.build.build.ddl.BuildComment;
import com.lideeyunji.tool.framework.sql.entity.FieldModel;
import com.lideeyunji.tool.framework.sql.core.model.SqlFormatModel;

import java.util.List;

/**
 * @author JX
 * @create 2024-07-06 11:45
 * @dedescription:
 */
public class SqlInfoCommentModel<T> extends SqlInfoBaseDdlModel {

    String tableName;
    String tableAlias;
    List<FieldModel> fieldModelList;



    private SqlInfoCommentModel(){}

    //构建表备注
    public static Builder builder(){
        return new Builder();
    }

    public static class Builder{

        private SqlInfoCommentModel model = new SqlInfoCommentModel();
        ISQLExpression<List<SqlFormatModel>> commentExpression = new BuildComment();

        public Builder setTableName(String tableName){
            model.tableName = tableName;
            return this;
        }
        public Builder setTableAlias(String tableAlias){
            model.tableAlias = tableAlias;
            return this;
        }
        public Builder setfieldModelList(List<FieldModel> fieldModelList){
            model.fieldModelList = fieldModelList;
            return this;
        }
        //增加字段
        public SqlInfoCommentModel<BuildComment> build(){
            model.setSqlExpression(commentExpression);
            return model;
        }
    }

    public String getTableName() {
        return tableName;
    }

    public String getTableAlias() {
        return tableAlias;
    }

    public List<FieldModel> getFieldModelList() {
        return fieldModelList;
    }
}
