[求助]反射和泛型的使用疑惑

接口:

public interface BaseService<T, PK extends Serializable> {
    boolean save(T record);
}

 接口:

public interface InfoService extends BaseService<Info, Long>{
    boolean save(Info record);
}

 实现类:

@Service("informationService")
public class InfoServiceImpl implements InfoService {
  boolean save(Info record) {
    ...
  }
}

在使用反射调用接口infoService的save(record)时,提示save(Info ...)不存在。

根据this.getClass().getMethods()获取的方法数组中,确实不存在save(Info ...),而仅仅存在save(Object ...)。

为了不在每个模块的Service中都定义一遍BaseService中的共有接口,有什么解决方案?

求帮助~~~

原文地址:https://www.cnblogs.com/Candies/p/6476563.html