feat: -m core 优化关联查询使用逗号分割时排除空值

This commit is contained in:
ruansheng 2025-09-23 19:59:30 +08:00
parent 41b52fa6c2
commit 01ab3023df

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()));
} }