24282 1 rok temu
rodzic
commit
9a4df54b4f

+ 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;