最近搭建SpringBoot+Mybatis时碰到了常见的nvalid bound statement (not found)错误,
按网友的解决方案梳理一遍,还是不行.最后发现是xml文件和mapper接口目录结构不一致的问题
两者的目录结构必须一样:
这样的话,target文件中mapper接口文件和xml文件会生成在一起.符合mybatis规范.如下图:
问题解决
最近搭建SpringBoot+Mybatis时碰到了常见的nvalid bound statement (not found)错误,
按网友的解决方案梳理一遍,还是不行.最后发现是xml文件和mapper接口目录结构不一致的问题
两者的目录结构必须一样:
这样的话,target文件中mapper接口文件和xml文件会生成在一起.符合mybatis规范.如下图:
问题解决