All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.quickdao.module.initial.flow.table.AutomaticCreateColumnFlow Maven / Gradle / Ivy

There is a newer version: 5.3.1
Show newest version
package cn.schoolwow.quickdao.module.initial.flow.table;

import cn.schoolwow.quickdao.domain.QuickDAOConfig;
import cn.schoolwow.quickdao.domain.entity.Entity;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;

import java.util.Collection;

public class AutomaticCreateColumnFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        QuickDAOConfig quickDAOConfig = (QuickDAOConfig) flowContext.checkData("quickDAOConfig");
        if(!quickDAOConfig.databaseOption.automaticCreateProperty){
            flowContext.remark("跳过自动新增列");
            return;
        }

        Collection entityList = quickDAOConfig.databaseContext.entityMap.values();
        for (Entity entity : entityList) {
            flowContext.startFlow(new CompareAndCreateColumnFlow())
                    .putTemporaryData("entity", entity)
                    .printTrace(false)
                    .execute();
        }
    }

    @Override
    public String name() {
        return "自动新增列";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy