Browse Source

在sqlSession未初始化前,进行等待

周浩 9 years ago
parent
commit
93b4753da3

+ 6 - 0
hsweb-web-dao-impl-mybatis/src/main/java/org/hsweb/web/mybatis/utils/ResultMapsUtils.java

@@ -11,6 +11,12 @@ public class ResultMapsUtils {
     private static SqlSession sqlSession;
 
     public static ResultMap getResultMap(String id) {
+        while (sqlSession == null) {
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+            }
+        }
         return sqlSession.getConfiguration().getResultMap(id);
     }