We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7314336 commit 957ba3dCopy full SHA for 957ba3d
1 file changed
APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java
@@ -6325,12 +6325,9 @@ LEFT JOIN ( SELECT count(*) AS count FROM sys.Comment ) AS Comment ON Comment.m
6325
//解决 pg 如果只查询关联键,会报找不到column的错误
6326
///* SELECT count(*) AS count FROM sys.Moment AS Moment
6327
// LEFT JOIN ( SELECT * FROM sys.Comment ) AS Comment ON Comment.momentId = Moment.id LIMIT 1 OFFSET 0 */
6328
- if (joinConfig.isMySQL()) {
6329
- if (column != null) {
6330
- for (On on : onList) {
6331
- column.add(on.getKey());
6332
- }
6333
-
+ if (column != null && joinConfig.isMSQL()) { // 暂时这样兼容 PostgreSQL 等不支持 SELECT 中不包含对应 key 的隐式 ON 关联字段的数据库
+ for (On on : onList) {
+ column.add(on.getKey()); // TODO PostgreSQL 等需要找到具体的 targetTable 对应 targetKey 来加到 SELECT,比直接 SELECT * 性能更好
6334
}
6335
6336
0 commit comments