异常记录

173 阅读1分钟

mybatis mapper-locations页

mybatis mapper-locations作用 application上配置了@MapperScan(扫面mapper类的路径)和pom.xml中放行了mapper.xml后,配置mapper-locations没有意义

查找后得知,如果mapper类和mapper.xml不在同一个路径下时,mapper-locations就有用了,在pom.xml中配置

mybatis.mapper-locations=classpath*:com/example/demo/mapper/*.xml

用mapper-locations指定mapper.xml的路径,实验成功