![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java基础
coder_NO.9
热爱学习,努力上进
展开
-
JPA实现大数据流式导出excel
Repository:@QueryHints(value = @QueryHint(name = HINT_FETCH_SIZE, value = "" + Integer.MIN_VALUE))@Query("写sql")Stream<Object[]> findByXXXX()使用的方法上必须加:@Transactional(readOnly = true)ExcelWriter excelWriter = EasyExcel.write(response.g..原创 2021-02-06 15:10:30 · 533 阅读 · 0 评论 -
Java collection集合截断
public class CollectionUtil { public static <T> Collection<Collection<T>> subCollection(Collection<T> collections, int maxNum) { int limit = countStep(collections.size(), maxNum); //方法一:使用流遍历操作// Collec.原创 2021-02-05 16:32:42 · 1408 阅读 · 0 评论 -
spring事件消息
数据对象:@Data@Builderpublic class SelfEvent { /** * 消息类型 */ private SelfEventTypeEnum selfEventTypeEnum; /** * 消息体 */ private Object body;}事件发布工具类:@Componentpublic class SelfEventService { private static原创 2020-12-21 14:56:50 · 117 阅读 · 0 评论 -
redis发布订阅模式
config: @Bean public MessageListenerAdapter messageListenerAdapter(RedisMsgPubSubListener redisMsgPubSubListener) { return new MessageListenerAdapter(redisMsgPubSubListener, "redisMsgPubSubListener"); } @Bean public RedisMess原创 2020-12-21 14:49:39 · 126 阅读 · 0 评论 -
redis工具类
@Componentpublic class RedisService { @Resource private RedisTemplate<String, Object> redisTemplate; /** * 写入缓存 * * @param key * @param value * @return */ public boolean set(final String key, Object va.原创 2020-12-21 14:47:28 · 195 阅读 · 0 评论 -
fegin配置aop日志
@Configuration@EnableFeignClients(basePackages = "com.hpkj.sys")@Import(FeignClientsConfiguration.class)public class FeignConfiguration { /** * Set the Feign specific log level to log client REST requests. */ @Bean feign.Logger.L.原创 2020-12-21 14:45:41 · 271 阅读 · 0 评论 -
Java数据结构总结
Set和List的区别Set 接口实例存储的是无序的,不重复的数据。List 接口实例存储的是有序的,可以重复的元素。 Set检索效率低下,删除和插入效率高,插入和删除不会引起元素位置改变 <实现类有HashSet,TreeSet>。 List和数组类似,可以动态增长,根据实际存储的数据的长度自动增长List的长度。查找元素效率高,插入删除效率低,因为会引起其他元素位置改变 &...原创 2019-03-25 17:38:57 · 180 阅读 · 0 评论