🐛 修复 ExtendServiceImpl 无法反射获取到 MapperClass 和 ModelClass 的问题

This commit is contained in:
b2baccline
2021-11-02 22:26:01 +08:00
parent a98291bb6c
commit 6df37ad7bb

View File

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.toolkit.ReflectionKit;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.hccake.extend.mybatis.plus.mapper.ExtendMapper;
import com.hccake.extend.mybatis.plus.service.ExtendService;
@@ -61,11 +60,11 @@ public class ExtendServiceImpl<M extends ExtendMapper<T>, T> implements ExtendSe
}
protected Class<M> currentMapperClass() {
return (Class<M>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServiceImpl.class, 0);
return (Class<M>) ReflectionKit.getSuperClassGenericType(this.getClass(), ExtendServiceImpl.class, 0);
}
protected Class<T> currentModelClass() {
return (Class<T>) ReflectionKit.getSuperClassGenericType(this.getClass(), ServiceImpl.class, 1);
return (Class<T>) ReflectionKit.getSuperClassGenericType(this.getClass(), ExtendServiceImpl.class, 1);
}
/**