正文:
最開始以為是因為該實體類不存在,檢查后發現該實體類是存在的。原因是Application.class中@MapperScan的注解,導入包應該為
import tk.mybatis.spring.annotation.MapperScan;
而不是
import org.mybaties.spring.annotation.MapperScan;
參考博客:
springBoot-tk.mybatis.mapper.MapperException: 無法獲取實體類com.example.demo.entity.User對應的表名! - Mint6的博客 - CSDN博客
https://blog.csdn.net/Mint6/article/details/88095239