81,092
社区成员
发帖
与我相关
我的任务
分享
if (shouldApplyAutomaticMappings(resultMap, false)) {
foundValues = applyAutomaticMappings(rsw, resultMap, metaObject, null) || foundValues;
}
shouldApplyAutomaticMappings 就是根据resultMap配置的autoMapping 或 配置中的autoMappingBehavior 字段,执行是否自动映射; 说白了自动映射也就是根据column名称在类中找对应的属性
private boolean shouldApplyAutomaticMappings(ResultMap resultMap, boolean isNested) {
if (resultMap.getAutoMapping() != null) {
return resultMap.getAutoMapping();
} else {
if (isNested) {
return AutoMappingBehavior.FULL == configuration.getAutoMappingBehavior();
} else {
return AutoMappingBehavior.NONE != configuration.getAutoMappingBehavior();
}
}
}