当前使用版本(必填,否则不予处理)
3.4.2
该问题是如何引起的?(确定最新版也有问题再提!!!)
定义带泛型的实体,注入baseMapper和IService
重现步骤(如果有就写完整)
- 实体类
public class BizApp<T> implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private T id;
}
- mapper.java
public interface BizAppMapper extends BaseMapper<BizApp<Long>> {
}
3, service
public interface IBizAppService extends IService<BizApp<Long>> {
}
- serviceImpl
public class BizAppServiceImpl extends ServiceImpl<BizAppMapper, BizApp<Long>> implements IBizAppService {
}
报错信息
Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [F:\java\biz\biz-server-ue\target\classes\mapper\admin\xml\BizAppMapper.xml]'; nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class
Comment From: miemieYaho
不支持
Comment From: wangsenyan
继承AbstractSqlInjector重写了extractModelClass,目前还没问题