【对线面试官】今天来聊聊Java泛型





public interface JpaRepository<T, ID> extends PagingAndSortingRepository<T, ID>, QueryByExampleExecutor<T> {
 List findAll() ;
 List findAll(Sort sort) ;
 List findAllById(Iterable ids)  ;
  List saveAll(Iterable entities);
 void flush();
  S saveAndFlush(S entity);
 void deleteInBatch(Iterable entities) ;
 void deleteAllInBatch();
 T getOne(ID id);
 @Override
  List findAll(Example example);
 @Override
  List findAll(Example example, Sort sort);
}


// 传入 需要group by 和 sum 的字段名
public cacheMap(List groupByKeys, List sumValues)   {
  this.groupByKeys = groupByKeys;
  this.sumValues = sumValues;
}
private void excute(T e) {
  
  // 从pojo 取出需要group by 的字段 list
  List


文章以纯面试的角度去讲解,所以有很多的细节是未铺垫的。
比如说反射和泛型基础,这些在【Java3y】都有过详细的基本教程甚至电子书,我就不再详述了。回复「888」即可获取
添加我的微信【sanwaiyihao】进一步交流和学习

评论
