List<PromotionForHomeDto> list = promotionBasicDao.
list(new WherePrams().orderBy("create_time desc"));
list = list.stream().sorted(Comparator.comparing(PromotionForHomeDto::getCreateTime))
.collect(Collectors.toList());
java8List根据某个属性排序
最新推荐文章于 2023-09-12 11:57:17 发布
这篇博客探讨了Java编程中如何使用DAO进行数据查询,并通过`list.stream().sorted()`进行排序。内容涉及`newWherePrams().orderBy()`方法用于数据库查询以及集合的流式处理和自定义排序。博客深入讨论了数据操作的效率和实践。
摘要由CSDN通过智能技术生成