ServiceImp error:
‘getBaseMapper()’ in ‘com.baomidou.mybatisplus.extension.service.impl.ServiceImpl’ clashes with ‘getBaseMapper()’ in ‘com.baomidou.mybatisplus.extension.service.IService’; attempting to use incompatible return type
In MyBatis-plus, the general reference package is
com.baomidou.mybatisplus.core.mapper;
Looking at the source code, we can see that both the IService and its implementation class ServiceImpl require the Mapper
<M extends BaseMapper<T>, T>
ServiceImpl<M extends BaseMapper<T>, T> implements IService<T>
Problem solving: check whether the mapper used in the self-defined xxservicei is a subclass of basemapper, and
Mapper generic reference should be consistent with iservice.
Read More:
- serviceimpl inherits generic public impl startup error: ClassCastException (Mybatis-plus version Issue)
- Springboot startup error: Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl required a bean of type
- [Solved] mybatisplus BaseMapper Error: required a single bean, but 2 were found
- Mybatisenumtypehandler upgrade error of mybatis plus
- How to Solve idea com.baomidou Error
- [Solved] Springboot Error: Error creating bean with name ‘xxxController‘
- C# Bug Fixed InvalidCastException: Cannot cast from source type to destination type.
- How to Solve the Primary Key of mybatisPlus Inserted Data is too Large Issue
- mybatis-plus Common Error and Their Solution
- Mybatis-plus: How to Execute Native SQL
- [Solved] BindingException: Type interface XXX is not known to the MapperRegistry
- [Solved] Mybatis-Plus Error: Invalid bound statement (not found)
- Initializingbean Interface & Applicationcontextaware Interface in Springboot
- [Solved] org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession…
- [Solved] Java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to java.util.List
- [Solved] Springboot error: Could Not Found xxmapper
- Java callback function implementation case
- Mybatis query error: Exception in thread “main” org.apache.ibatis.exceptions.PersistenceException…
- [Solved] Failed to configure a DataSource: ‘url‘ attribute is not specified…bug