05 2022 档案
摘要:一、问题 使用Iterator在对List集合进行遍历集合时,如果只是遍历而不进行增加、删除操作时,可以正常运行吗,但是如果我们在使用迭代器对List集合进行插入或者删除时,就会出现Exception in thread "main" java.util.ConcurrentModification
阅读全文
摘要:一、环境搭建 创建一个maven工程,然后引入mybatis依赖和mysql依赖即可。 <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.0.4</version> </de
阅读全文
摘要:推荐:MyBatis Plus汇总 mybatis-plus分页查询 首先创建一个数据库表,如下图所示: 然后创建一个Spring Boot项目,pom.xml和配置如下: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://m
阅读全文
摘要:方法一: mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志 或者: mybatis-plus: configuration: log-impl: org.apache
阅读全文
摘要:项目开发过程中,难免会有许多定时任务的需求进来。如果项目中还没有引入quarzt框架的情况下,我们通常会使用Spring的@Schedule(cron="* * * * *")注解 样例如下: package com.slowcity.redis; import org.slf4j.Logger;
阅读全文
摘要:流的创建(演示常用的) 数组创建 Arrays.streamArrays的静态方法stream() 可以获取数组流 String[] arr = { "a", "b", "c", "d", "e", "f", "g" }; Stream<String> stream = Stream.of(arr)
阅读全文
摘要:推荐一个工具网站:Java代码生成平台 添加依赖: <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.8.1</version> </dependency> Hutool官
阅读全文