24282 1 year ago
parent
commit
9a4df54b4f
1 changed files with 2 additions and 4 deletions
  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;