确认
当前程序版本
3.5.9
问题描述
在sonlon中,正常启动项目,但是调用IcoDAO ,
会报错Type interface com.cn.dao.ico.IcoDAO is not known to the MybatisPlusMapperRegistry
该类无对应的mapper.xml,加上一个mapper.xml后可以解决该问题
package com.cn.dao.ico;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.pojo.po.IcoPO;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IcoDAO extends BaseMapper<IcoPO> {
}
详细堆栈日志
org.apache.ibatis.binding.BindingException: Type interface com.cn.dao.ico.IcoDAO is not known to the MybatisPlusMapperRegistry.
at com.baomidou.mybatisplus.core.MybatisMapperRegistry.lambda$getMapper$1(MybatisMapperRegistry.java:54)
at java.util.Optional.orElseThrow(Optional.java:290)
at com.baomidou.mybatisplus.core.MybatisMapperRegistry.getMapper(MybatisMapperRegistry.java:54)
at com.baomidou.mybatisplus.core.MybatisConfiguration.getMapper(MybatisConfiguration.java:197)
at org.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(DefaultSqlSession.java:291)
at com.baomidou.mybatisplus.core.override.SolonMybatisMapperProxy.invoke(SolonMybatisMapperProxy.java:29)
at com.sun.proxy.$Proxy34.selectList(Unknown Source)
at com.cn.service.ico.IcoServiceImpl.updateIco(IcoServiceImpl.java:75)
对比两个3.5.9版本
mybatis-plus-boot-starter
mybatis-plus-solon-plugin
是调用com.baomidou.mybatisplus.core.MybatisConfiguration#addMapper 方法进行Mapper注入
- 以下为spring的调用链路
- 以下是solon的调用链路
spring会触发org.mybatis.spring.mapper.MapperFactoryBean#checkDaoConfig 方法 进行注入
solon要怎么实现请帮忙解决一下