MapperScan路径
时间: 2023-10-03 20:04:59 浏览: 79
路径查询
在Spring Boot中,可以使用@MapperScan注解来指定扫描@Mapper接口的类路径。该注解可以在启动类上使用,并通过指定value或basePackages属性来设置扫描路径。例如,可以使用以下方式指定扫描路径:
@MapperScan({"com.github.mybatis.crud.mapper"})
这样,Spring Boot将扫描com.github.mybatis.crud.mapper包下的所有使用@Mapper注解的接口,并为其生成代理对象。 <span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [default-core:springboot-web一些默认实现](https://download.csdn.net/download/weixin_42133969/16600633)[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_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [mybatis2-@MapperScan扫描接口](https://blog.csdn.net/weixin_42145727/article/details/127247558)[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_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文