mybatis-plus引入和解决报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
启动报错信息
Property 'configuration' and 'configLocation' can not specified with together
引入配置注意事项
下边开启了驼峰命名法需要改config-location为config-locations
mybatis-plus: config-location: classpath:mybatis/mybatis-config.xml # 配置mapper.xml路径 mapper-locations: classpath*:mapper/**/*Mapper.xml # 检查xml文件是否存在 check-config-location: true configuration: # 开启驼峰命名法 map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl type-aliases-package: com.xx.xx.**.domain
正确的
mybatis-plus: config-locations: classpath:mybatis/mybatis-config.xml # 配置mapper.xml路径 mapper-locations: classpath*:mapper/**/*Mapper.xml # 检查xml文件是否存在 check-config-location: true configuration: # 开启驼峰命名法 map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl type-aliases-package: com.xx.xx.**.domain
解决报错:Invalid bound statement (not found)
新生成的 Mapper XML 文件名不符合 mapper-locations
规则
mapper-locations: classpath*:mapper/**/*Mapper.xml
1. 新建mapper.xml文件时候没有以mapper.xml文件名结尾
2. 新建模块时候,在resources下新建的mapper及mapper下的目录如:mapper/user/UserMapper.xml而不是mapper.user/UserMapper.xml