Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 99b910a

Browse files
authored
解决 JOIN ON 不支持 @cast,感谢 lindaifeng 的贡献~ Tencent#785
Tencent#785
1 parent 30b23c0 commit 99b910a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4847,9 +4847,10 @@ protected String concatJoinOn(@NotNull String sql, @NotNull String quote, @NotNu
48474847

48484848
String rt = on.getRelateType();
48494849
if (StringUtil.isEmpty(rt, false)) {
4850-
//解决join不支持@cast问题
4851-
Map castMap = j.getJoinConfig().getCast();
4852-
if (castMap.isEmpty()) {
4850+
// 解决 JOIN ON 不支持 @cast 问题
4851+
SQLConfig jc = j.getJoinConfig();
4852+
Map<String, String> castMap = jc == null ? null : jc.getCast();
4853+
if (castMap == null || castMap.isEmpty()) {
48534854
sql += (first ? ON : AND) + quote + jt + quote + "." + quote + on.getKey() + quote + (isNot ? " != " : " = ")
48544855
+ quote + on.getTargetTable() + quote + "." + quote + on.getTargetKey() + quote;
48554856
} else {

0 commit comments

Comments
 (0)