resultMap type 不写全名没报错
时间: 2023-08-19 15:08:04 浏览: 104
回答: 在resultMap中配置constructor节点时,可以不写全名的type属性,而不会报错。这是因为MyBatis会根据上下文推断出type的具体类型。在这种情况下,MyBatis会根据构造函数的参数类型来确定type的具体类型。所以即使不写全名,MyBatis仍然能够正确地解析和映射属性。\[2\]
#### 引用[.reference_title]
- *1* *3* [知了堂学习笔记--mybatis学习_resultMap的使用](https://blog.csdn.net/abstract_yt/article/details/79273261)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [mybatis中resultMap配置细则](https://blog.csdn.net/victoylin/article/details/79691292)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文