说明:SpingBoot整合Mybaties常见错误
- SpingBoot无法找到mapper接口,和对应的xml文件
扫描mapper接口:在启动类中加入注解
@MapperScan("test.mapper")
- 在资源文件applicaton.properties(yml)中指定xml文件所在位置
#mapper映射的xml文件
mybatis.mapper-locations=classpath*:test/mapper/**.xml
在这里插入代码片
说明:SpingBoot整合Mybaties常见错误
@MapperScan("test.mapper")
#mapper映射的xml文件
mybatis.mapper-locations=classpath*:test/mapper/**.xml
在这里插入代码片