Merge pull request #587 from ruansheng8/fix-relationQueryNullValue

feat: -m core 优化关联查询使用逗号分割逻辑
This commit is contained in:
Michael Yang 2025-09-25 19:23:03 +08:00 committed by GitHub
commit 3618f70055
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,6 +74,10 @@ public class ToManyRelation<SelfEntity> extends AbstractRelation<SelfEntity> {
} }
String[] splitValues = ((String) targetValue).split(selfValueSplitBy); String[] splitValues = ((String) targetValue).split(selfValueSplitBy);
for (String splitValue : splitValues) { for (String splitValue : splitValues) {
// 排除空值
if (splitValue == null || splitValue.length() == 0) {
continue;
}
//优化分割后的数据类型(防止在数据库查询时候出现隐式转换) //优化分割后的数据类型(防止在数据库查询时候出现隐式转换)
newTargetValues.add(ConvertUtil.convert(splitValue, targetFieldWrapper.getFieldType())); newTargetValues.add(ConvertUtil.convert(splitValue, targetFieldWrapper.getFieldType()));
} }