24282 1 년 전
부모
커밋
9a4df54b4f
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      my-test/src/main/java/org/example/join/sql/SqlContext.java

+ 2 - 4
my-test/src/main/java/org/example/join/sql/SqlContext.java

@@ -56,13 +56,11 @@ public class SqlContext {
     }
 
     public static String getTableAlias(Table table) {
-        Map<String, String> tableAliasMap = getTableAliasMap();
         String tableAlias = table.getAlias();
-        String tableName = table.getName();
         if (StrUtil.isBlank(tableAlias)) {
-            tableAlias = tableAliasMap.get(tableName);
+            tableAlias = getTableAliasMap().get(table.getName());
             if (StrUtil.isBlank(tableAlias)) {
-                throw new IllegalArgumentException("未知连表:" + tableName);
+                throw new IllegalArgumentException("未知连表:" + table.getName());
             }
         }
         return tableAlias;