(1)创建Spring Boot项目MyBatisDemo
引入MySQL和MyBatis的依赖启动器
查看pom.xml文件
(2)创建评论实体类Comment
(3)创建文章实体类Article
(二)使用注解方式整合MyBatis
1、创建Mapper接口CommentMapper
2、在测试类编写测试方法
注入评论映射器
(1)创建测试方法testFindById()
(2)创建测试方法testFindAll()
(3)创建测试方法testInsertComment()
(4)创建测试方法testUpdateComment()
(5)创建测试方法testDeleteComment()
(三)使用配置文件方式整合MyBatis
1、创建Mapper接口文件 - ArticleMapper
2、创建映射器配置文件ArticleMapper.xml
在resources目录里创建mapper目录,在mapper目录里创建ArticleMapper.xml