resultType与resultMap区别
时间: 2023-11-06 09:06:08 浏览: 85
MyBatis中的resultMap简要概述
resultType和resultMap在MyBatis中用于查询结果的映射,但它们有一些区别。resultType用于直接表示返回类型,指定一个Java类作为返回结果的类型。这意味着查询结果会被转换为指定的Java类的对象。而resultMap是对外部ResultMap的引用,可以引用一个已经定义好的ResultMap。这个ResultMap定义了查询结果与Java类之间的映射关系,包括列名与属性名的对应关系、类型转换等。可以说,resultType是直接指定返回类型,而resultMap是引用一个已有的映射关系。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [resultMap与resultType的区别](https://blog.csdn.net/LMY0210/article/details/128238290)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [resulttype和resultMap区别详解](https://blog.csdn.net/qq_26893841/article/details/127883346)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [MyBatis中关于resultType和resultMap的区别介绍](https://download.csdn.net/download/weixin_38717031/12793901)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文