项目使用MyBatiesPlus时,调用方法出现异常:Cannot execute table Method, ClassGenricType not found.
项目使用MyBatiesPlus时,调用方法出现异常
MybatisPlusException: Error: Cannot execute table Method, ClassGenricType not found
原因:
- 对应实体mapper没有继承 BaseMapper<> 且实现对应的泛型。
- 对应的实体类没有加上@TableName注解。
异常如下:
解决方法:
1、mapper接口上继承BaseMapper<>实现泛型;
2、实体类加上@TableName注解。