java - spring boot和mybatis整合中,mapper的xml文件应该如何配置

查看:533
本文介绍了java - spring boot和mybatis整合中,mapper的xml文件应该如何配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

在尝试进行spring boot和mybatis的整合,但运行时总是报Invalid bound statement (not found)这个错,搜索了一下很多人认为是mapper找不到所致,我是用工具生成的mapper,有接口和xml文件两个部分,xml文件位置在application.yml中该如何配置呢?我现在的配置如下

spring:
  datasource:
    username: root
    password:
    url: jdbc:mysql://localhost:3306/test
    driver-class-name: com.mysql.jdbc.Driver

mybatis:
  mapperLocations: classpath:mapping/*.xml

解决方案

已经解决,是mapper的xml文件路径配置问题

这篇关于java - spring boot和mybatis整合中,mapper的xml文件应该如何配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆