Skip to content

一、基本配置

本部分配置包含了大部分用户的常用配置,其中一部分为 MyBatis 原生所支持的配置

使用 Mapper.xml 映射 Mapper.java 接口类

MyBatis Mapper 所对应的 XML 文件位置

  • 如果您在 Mapper 中有自定义方法(XML 中有自定义实现),需要进行该配置,告诉 Mapper 所对应的 XML 文件位置
yaml
# MyBatis Plus 配置
mybatis-plus:
  # 映射的Mapper.xml 文件
  mapper-locations: classpath*:/mapper/**/*.xml

注意事项

Maven 多模块项目的扫描路径需以 classpath*: 开头 (即加载多个 jar 包下的 XML 文件) :::