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


import com.jeelowcode.framework.plus.build.ISQLExpression;
import com.jeelowcode.framework.plus.build.build.ddl.BuildPrimaryKey;
import com.jeelowcode.framework.plus.core.model.SqlFormatModel;

import java.util.List;

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

    String tableName;//表
    List<String> keyList;

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

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

        public Builder setPrimaryKey(List<String> keyList) {
            sqlInfoCreateModel.keyList = keyList;
            return this;
        }

        public SqlInfoPrimaryKeyModel build() {
            sqlInfoCreateModel.setSqlExpression(primaryKeyExpression);
            return sqlInfoCreateModel;
        }
    }


    public String getTableName() {
        return tableName;
    }

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

    public List<String> getKeyList() {
        return keyList;
    }

    public void setKeyList(List<String> keyList) {
        this.keyList = keyList;
    }

}
