package com.ruoyi.framework.config;

import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import javax.sql.DataSource;

@Configuration
public class SqlSessionFactoryConfig {

    @Autowired
    CreateSqlSessionFactory createSqlSessionFactory;

    @Bean
    public SqlSessionFactory sqlSessionFactory(Environment env,DataSource dataSource) throws Exception
    {
        return createSqlSessionFactory.createSqlSessionFactory(env,dataSource);
    }
}
