springboot mybatis 实体类正常 报错找不到

来源:互联网 发布:sql查询前三条 编辑:程序博客网 时间:2024/06/03 15:38

项目使用spring boot 集成mybatis通用mapper插件,发现查询方法selectOne

会导致发生异常—— Java.lang.ClassCastException:com.xxx.xxx.entity cannot be cast to com.xxx.xxx.entity


增删改都没问题 只有查询报错


解决方法如下:

创建目录

  resource

    META-INF

      spring-devtools.properties


加入以下代码

restart.include.companycommonlibs=tk/mybatis.*