package cn.reghao.tnb.sb.db.mybatis.test.config;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;

/**
 * @author reghao
 * @date 2021-12-29 14:10:37
 */
public class MyBatisConfig {
    public static SqlSessionFactory sqlSessionFactory() {
        String env = "dev";
        String resource = "mybatis/config/mybatis-config.xml";
        InputStream is = MyBatisConfig.class.getClassLoader().getResourceAsStream(resource);
        return new SqlSessionFactoryBuilder().build(is, env);
    }
}
