在使用通用mapper执行查询时,由于不太注意顺手就导了spring的包:
import org.mybatis.spring.annotation.MapperScan;
结果就异常:tk.mybatis.mapper.provider.base.BaseSelectProvider:xxxx
找了半天才发现是包的问题,应该导mybatis的MapperScan而不是spring中的包,正确的包名:
import tk.mybatis.spring.annotation.MapperScan;
本文分享了一个在使用MyBatis通用Mapper时常见的错误:错误地导入了Spring框架中的MapperScan,而非MyBatis的MapperScan,导致运行时出现异常。正确的方式应当导入tk.mybatis.spring.annotation.MapperScan。
3946

被折叠的 条评论
为什么被折叠?



