2020-03-18记框架整合加入mybatis-plus后找不

2020-03-18  本文已影响0人  夜色001

引入mybatis-plus后,调用dao中的接口,出现Invalid bound statement (not found)异常

exception type:org.apache.ibatis.binding.BindingException, exception message:Invalid bound statement (not found): 
pro....ktwelve.modules.sys.dao.SysUserDao.queryByUserName, requestUrl:/sys/login
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 
pro....ktwelve.modules.sys.dao.SysUserDao.queryByUserName
    at com.baomidou.mybatisplus.core.override.PageMapperMethod$SqlCommand.<init>(PageMapperMethod.java:261)
Resolved [org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 
pro....ktwelve.modules.sys.dao.SysUserDao.queryByUserName]

解决方法:修改配置文件mybatis改为mybatis-plus

mybatis-plus:
  type-aliases-package: pro...domain,pro....ktwelve.modules.sys.entity
  mapper-locations: classpath*:/mappers/*.xml,classpath*:/mappers/**/*.xml
  configuration:
    mapUnderscoreToCamelCase: true
    map-underscore-to-camel-case: true
    #强力的SQL打印
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

另外要注意mapper-locations的写法:classpath后的不可少,*.xml也不能少,否则可能报文件找不到的错误

Caused by: java.nio.file.AccessDeniedException: F:\git-source\mayun\ktwelve_Server\k12-business\target\classes\mappers\sys
上一篇下一篇

猜你喜欢

热点阅读