spring boot整合mybatis
2020-12-13 04:58
阅读:322
标签:runner cat bat mic image -- dep enc tor
spring boot整合mybatis
1.添加mybatis依赖和mysql依赖
mysql
mysql-connector-java5.1.46
org.mybatis
mybatis-spring1.3.2 org.mybatis
mybatis3.4.6 org.mybatis.spring.boot
mybatis-spring-boot-starter2.0.1
2.编写配置文件
a. application.yml
b. application-dev.yml
3.在启动类上加上注解@MapperScan("mpper接口所在的包的路径")
4.编写mapper类
5.测试。注:实现CommandLineRunner接口,会做一些初始化的操作
spring boot整合mybatis
标签:runner cat bat mic image -- dep enc tor
原文地址:https://www.cnblogs.com/huoyufei/p/11127189.html
评论
亲,登录后才可以留言!