|
@@ -1,14 +1,9 @@
|
|
|
package com.ruoyi.framework.config;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import javax.sql.DataSource;
|
|
|
+import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import org.apache.ibatis.io.VFS;
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
-import org.mybatis.spring.SqlSessionFactoryBean;
|
|
|
import org.mybatis.spring.boot.autoconfigure.SpringBootVFS;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
@@ -22,7 +17,13 @@ import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
|
|
|
import org.springframework.core.type.classreading.MetadataReader;
|
|
|
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
+
|
|
|
+import javax.sql.DataSource;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Mybatis支持*匹配扫描包
|
|
@@ -122,7 +123,7 @@ public class MyBatisConfig
|
|
|
typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
|
|
|
VFS.addImplClass(SpringBootVFS.class);
|
|
|
|
|
|
- final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
|
|
|
+ final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
|
|
|
sessionFactory.setDataSource(dataSource);
|
|
|
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
|
|
|
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
|