mapperscan
时间: 2023-09-22 12:09:40 浏览: 89
@MapperScan注解是用于扫描Mapper接口并将其实例化后交给Spring容器管理的注解。它可以指定Mapper接口所在的包路径,使得在应用启动时,Spring Boot会自动扫描该包下的所有Mapper接口,并将其实例化后交给Spring容器管理。这样,我们就可以在其他组件中使用这些Mapper接口的实现类。@MapperScan注解常用于MyBatis框架中,用于自动扫描Mapper接口并创建其实现类的代理对象,从而方便地进行数据持久化操作。\[1\]\[3\]
#### 引用[.reference_title]
- *1* *3* [@MapperScan注解有什么用](https://blog.csdn.net/IsAmant/article/details/129231782)[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-Plus @MapperScan用与不用区别](https://blog.csdn.net/weixin_44008360/article/details/124078799)[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 ]
阅读全文