新建springboot项目
在pom.xml文件中导入整合的关键jar包:mybatis-spring-boot-starter
新建User实体类和对应的接口类:
在接口上使用@Mapper和@Repository注解
在Spring配置文件中配置mybatis别名和映射关系,当然也可以在mybatis.config文件中配置并导入
至此,springboot和mybatis就简单整合起来了
新建springboot项目
在pom.xml文件中导入整合的关键jar包:mybatis-spring-boot-starter
新建User实体类和对应的接口类:
在接口上使用@Mapper和@Repository注解
在Spring配置文件中配置mybatis别名和映射关系,当然也可以在mybatis.config文件中配置并导入
至此,springboot和mybatis就简单整合起来了
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。