@mapperscan注解的使用
时间: 2023-09-29 18:03:58 浏览: 148
spring boot 整合mybatis,基于@Select注解方式
4星 · 用户满意度95%
@mapperscan注解的使用是为了告诉Spring Boot应用程序去扫描指定的包或子包下的mapper接口。在Spring Boot主程序中,如果mapper类没有在可以扫描的包或子包下面,就需要使用@mapperscan注解来进行配置。可以通过在@SpringBootApplication注解中使用@mapperscan注解来指定需要扫描的包或子包。例如,可以使用如下方式配置注解:@SpringBootApplication @MapperScan({"com.kfit.*.mapper","org.kfit.*.mapper"})。这样配置后,Spring Boot应用程序就会扫描指定的包或子包下的mapper接口,并进行相应的配置和初始化。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [@MapperScan注解使用](https://blog.csdn.net/manchengpiaoxue/article/details/84937257)[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* [7、注解@Mapper、@MapperScan](https://blog.csdn.net/nba_linshuhao/article/details/82783454)[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 ]
阅读全文