From f79abc50fcedd7a99161dd32f82ae8cc2c52e548 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 19 Jan 2024 10:19:58 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9Acode=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mybatisflex/core/relation/RelationManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java index 17dee5bb..a152af3e 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java @@ -327,10 +327,10 @@ public class RelationManager { //通过中间表关联查询 if (relation.isRelationByMiddleTable()) { - targetValues = new HashSet<>(); + Set selfFieldValues = relation.getSelfFieldValues(entities); // 当数据对应的字段没有值的情况下,直接返回 - if(selfFieldValues.isEmpty()) { + if (selfFieldValues.isEmpty()) { return; } QueryWrapper queryWrapper = QueryWrapper.create().select() @@ -346,6 +346,8 @@ public class RelationManager { return; } + targetValues = new HashSet<>(); + for (Row mappingData : mappingRows) { Object targetValue = mappingData.getIgnoreCase(relation.getJoinTargetColumn()); if (targetValue != null) {