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


import com.jeelowcode.framework.plus.build.ISQLExpression;
import com.jeelowcode.framework.plus.build.build.ddl.BuildCreateTable;
import com.jeelowcode.framework.plus.entity.FieldModel;
import com.jeelowcode.framework.plus.core.model.SqlFormatModel;

import java.util.List;

/**
 * @author JX
 * @create 2024-07-05 17:09
 * @dedescription:
 */
public class SqlInfoCreateModel<T> extends SqlInfoBaseDdlModel {

    String tableName;//表
    List<FieldModel> tableOptions;

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

    public static class Builder{
        private SqlInfoCreateModel sqlInfoCreateModel = new SqlInfoCreateModel();
        ISQLExpression<List<SqlFormatModel>> createTableExpression = new BuildCreateTable();
        public Builder setTableName(String tableName) {
            sqlInfoCreateModel.tableName = tableName;
            return this;
        }

        public Builder setTableOptions(List<FieldModel> tableOptions) {
            sqlInfoCreateModel.tableOptions = tableOptions;
            return this;
        }

        public  SqlInfoCreateModel<BuildCreateTable> build() {
            sqlInfoCreateModel.setSqlExpression(createTableExpression);
            return sqlInfoCreateModel;
        }
    }


    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public List<FieldModel> getTableOptions() {
        return tableOptions;
    }

    public void setTableOptions(List<FieldModel> tableOptions) {
        this.tableOptions = tableOptions;
    }

}
