接口:
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中的共有接口,有什麼解決方案?
求幫助~~~
作者:
Candyメ奶糖出處:
http://www.cnblogs.com/Candies/本文版權歸作者和部落格園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接配接,否則保留追究法律責任的權利。
博文來源廣泛,如原作者認為我侵犯知識産權,請盡快給我發郵件
[email protected]聯系,我将以第一時間删除相關内容。