| | |
| | | import com.vci.ubcs.starter.util.VciSpringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @author LiHang |
| | | * @date 2023/4/24 |
| | | */ |
| | | @Component |
| | | public class DdlMapperProcessStrategy { |
| | | |
| | | @Value("${spring.datasource.driver-class-name}") |
| | | private static final String DATABASE_DRIVER = ""; |
| | | private String DATABASE_DRIVER; |
| | | |
| | | private final static List<DdlMapperProcessor> PROCESSORS = Lists.newArrayList(); |
| | | |
| | |
| | | PROCESSORS.add(VciSpringUtil.getBean(DdlOracleMapperProcessor.class)); |
| | | PROCESSORS.add(VciSpringUtil.getBean(DdlMySqlMapperProcessor.class)); |
| | | PROCESSORS.add(VciSpringUtil.getBean(DdlMsMapperProcessor.class)); |
| | | PROCESSORS.add(VciSpringUtil.getBean(DdlDmMapperProcessor.class)); |
| | | } |
| | | |
| | | public static DdlMapperProcessor getProcessor(){ |
| | | @Bean("ddlMapper") |
| | | public DdlMapperProcessor getProcessor(){ |
| | | for (DdlMapperProcessor processor : PROCESSORS) { |
| | | if (processor.support(DATABASE_DRIVER)){ |
| | | System.out.println("==========================================="); |
| | | System.out.println("获取DDL操作类成功:" + processor.getClass().getName()); |
| | | return processor; |
| | | } |
| | | } |