好久没有自己搭建项目了,果然手生了不少,好多东西都忘记了,尤其是一些细节,今天记录一下,加深印象.
1 . Invalid bound statement (not found): com.redismybates.mapper.EmpMapper.updateByPrimaryKey
这个是在访问的时候报方法找不到
缺少配置
mybatis.mapper-locations=classpath*:mapping/*.xml
这个配置就是告诉启动类mapper的位置,让他去找,
**2.**显示sql语句
logging.level.com.redismybates.mapper=debug
3.
Field empMapper in com.redismybates.service.EmpService required a bean of type ‘com.redismybates.mapper.EmpMapper’ that could not be found.
这个是报mapper接口找不到
解决办法在启动类上添加@MapperScan(“com.redismybates.mapper”)