瀏覽代碼

过时方法

nieqiurong 8 年之前
父節點
當前提交
10830b9e38

+ 2 - 2
mybatis-plus/src/main/java/com/baomidou/mybatisplus/spring/MybatisSqlSessionFactoryBean.java

@@ -383,7 +383,7 @@ public class MybatisSqlSessionFactoryBean implements FactoryBean<SqlSessionFacto
      * @return SqlSessionFactory
      * @throws IOException if loading the config file failed
      */
-    protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
+    protected SqlSessionFactory buildSqlSessionFactory() throws Exception {
 
         Configuration configuration;
 
@@ -524,7 +524,7 @@ public class MybatisSqlSessionFactoryBean implements FactoryBean<SqlSessionFacto
         if (!isEmpty(this.mapperLocations)) {
             if (globalConfig.isRefresh()) {
                 //TODO 设置自动刷新配置 减少配置
-                new MybatisMapperRefresh(this.mapperLocations, sqlSessionFactory, 2,
+                new MybatisMapperRefresh(sqlSessionFactory, 2,
                         2, true);
             }
             for (Resource mapperLocation : this.mapperLocations) {

+ 2 - 3
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/MybatisMapperRefreshTest.java

@@ -15,7 +15,6 @@
  */
 package com.baomidou.mybatisplus.test;
 
-import java.io.IOException;
 import java.io.InputStream;
 
 import org.apache.ibatis.session.SqlSession;
@@ -47,13 +46,13 @@ public class MybatisMapperRefreshTest {
     /**
      * 测试 Mybatis XML 修改自动刷新
      */
-    public static void main(String[] args) throws IOException, InterruptedException {
+    public static void main(String[] args) throws Exception {
         InputStream in = UserMapperTest.class.getClassLoader().getResourceAsStream("mysql-config.xml");
         MybatisSessionFactoryBuilder mf = new MybatisSessionFactoryBuilder();
         mf.setGlobalConfig(new GlobalConfiguration(new MySqlInjector()));
         Resource[] resource = new ClassPathResource[]{new ClassPathResource("mysql/UserMapper.xml")};
         SqlSessionFactory sessionFactory = mf.build(in);
-        new MybatisMapperRefresh(resource, sessionFactory, 0, 5, true);
+        new MybatisMapperRefresh(sessionFactory, 0, 5, true);
         boolean isReturn = false;
         SqlSession session = null;
         while (!isReturn) {