From af9fa76b2e83fcb125b731ea8c4838955745ea2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=80=E6=BA=90=E6=B5=B7=E5=93=A5?= Date: Sat, 23 Sep 2023 15:11:53 +0800 Subject: [PATCH] fix: AbstractRelation NPE --- .../java/com/mybatisflex/core/relation/AbstractRelation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/AbstractRelation.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/AbstractRelation.java index 7cac0dd1..fb6f1fce 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/AbstractRelation.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/AbstractRelation.java @@ -98,7 +98,8 @@ abstract class AbstractRelation { this.valueField = valueField; this.onlyQueryValueField = StringUtil.isNotBlank(valueField); - this.conditionColumn = column(targetTable, targetTableInfo.getColumnByProperty(this.targetField.getName())); + this.conditionColumn = targetTableInfo == null ? column(targetTable, StringUtil.camelToUnderline(this.targetField.getName())) + : column(targetTable, targetTableInfo.getColumnByProperty(this.targetField.getName())); if (onlyQueryValueField) { //仅绑定字段时只需要查询关联列和该字段列即可