mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
Merge pull request #587 from ruansheng8/fix-relationQueryNullValue
feat: -m core 优化关联查询使用逗号分割逻辑
This commit is contained in:
commit
3618f70055
@ -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()));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user