Ver código fonte

去除日志警告打印.

聂秋秋 7 anos atrás
pai
commit
2e0b0e327e

+ 1 - 1
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/GlobalConfigUtils.java

@@ -62,7 +62,7 @@ public class GlobalConfigUtils {
      */
     public static SqlSessionFactory currentSessionFactory(Class<?> clazz) {
         TableInfo tableInfo = TableInfoHelper.getTableInfo(clazz);
-        Assert.notNull(tableInfo, ClassUtils.getUserClass(clazz).getName() + "Not Found TableInfoCache.");
+        Assert.notNull(tableInfo, ClassUtils.getUserClass(clazz).getName() + " Not Found TableInfoCache.");
         String configMark = tableInfo.getConfigMark();
         GlobalConfig mybatisGlobalConfig = getGlobalConfig(configMark);
         return mybatisGlobalConfig.getSqlSessionFactory();

+ 1 - 4
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/TableInfoHelper.java

@@ -83,10 +83,7 @@ public class TableInfoHelper {
             currentClass = currentClass.getSuperclass();
             tableInfo = TABLE_INFO_CACHE.get(ClassUtils.getUserClass(currentClass).getName());
         }
-        if (null == tableInfo) {
-            //找不到了,我也很绝望呀
-            logger.warn(ClassUtils.getUserClass(clazz).getName() + " Not Found TableInfoCache.");
-        } else {
+        if (tableInfo != null) {
             TABLE_INFO_CACHE.put(ClassUtils.getUserClass(clazz).getName(), tableInfo);
         }
         return tableInfo;