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

com.anji.plus.gaea.archiver.sqlbuilder.SQLBuilderFactory Maven / Gradle / Ivy

package com.anji.plus.gaea.archiver.sqlbuilder;

import com.anji.plus.gaea.archiver.consant.DBType;

import java.util.Optional;
/**
 * SQL构建器工厂
 *
 * @author 木子李·De
 * @since 2021/2/3 14:16
 */
public class SQLBuilderFactory {

    private static final SQLBuilderRegistry sqlBuilderRegistry = new SQLBuilderRegistry();

    public static ISQLBuilder getSQLBuilder(DBType dbType){
        return Optional.ofNullable(sqlBuilderRegistry.getSQLBuilder(dbType)).orElseThrow(()->
            new RuntimeException(String.format("%s database not supported", dbType.getDb()))
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy