SpringBoot配置Mybatis的两种方式(通过XML配置和通过YML配置文件配置)_springboot mybatis配置-CSDN博客

网站介绍:文章浏览阅读3w次,点赞24次,收藏85次。一、 通过XML的方式配置Mybatis在 /src/main/resource下创建Mybatis配置文件 mybatis-config.xml 和 映射文件目录mapper在application.yml指定Mybatis配置文件、映射文件的位置可选:- mybatis.config-location:配置 mybatis-config.xml 路径mybatis-config.xml 中配置 MyBatis 基础属性- mybatis.mapper-locations:配置 Mapper _springboot mybatis配置