首页
学习
活动
专区
工具
TVP
发布

翟凤玺

专栏作者
55
文章
86724
阅读量
14
订阅数
通过 MongoTemplate 按ID或其他字段删除
翟凤玺
2023-10-19
3230
使用 MongoRepository 按ID以外字段进行删除操作
根据除 _id 以外的字段进行删除,可以使用自定义的查询方法来实现。可以在自定义的查询方法中使用 MongoDB 的查询语法来指定删除条件,从而根据其他字段进行删除。
翟凤玺
2023-10-19
1960
java 中 parallelStream 和 stream 方法区别
Stream 和 parallelStream 都是用于处理集合数据的流式操作的方法。区别如下:
翟凤玺
2023-10-19
2970
java 中 orElse 和 orElseGet 方法区别
orElse 和 orElseGet 是 Optional 类的两个方法,用于处理可能为空的值。
翟凤玺
2023-10-19
1970
SpringBoot @RequestBody 中校验入参
导读 在restful对外暴露的接口中,只有一个参数,但是需要对这个参数值做校验,在不创建新的类的前提下,可以用如下方式,优雅的校验入参。 @Validated //注意这里 @RestController @RequestMapping("/api/") public class TestController { @DeleteMapping("") public void delete(@RequestBody @NotEmpty(message = "lists is Required")
翟凤玺
2022-11-14
4530
NullPointerException: element cannot be mapped to a null key
报错 java.lang.NullPointerException: element cannot be mapped to a null key 问题代码 import java.util.ArrayList; import java.util.stream.Collectors; import lombok.Builder; import lombok.Data; @Data @Builder public class S { private String a; private S
翟凤玺
2022-09-21
1.1K0
Failed to instantiate java.util.List using constructor NO_CONSTRUCTOR with arguments
报错 MappingInstantiationException: Failed to instantiate java.util.List using constructor NO_CONSTRUCTOR with arguments 原因 mongo库中a集合映射的实体类 @Data @NoArgsConstructor @AllArgsConstructor @Document(collection = "a") public class A { private List<B> b; // 这
翟凤玺
2022-07-27
8030
mongo @CreatedDate @LastModifiedDate注解不生效
代码 @Data public class MongoCommonField { @Id private String id; @Version private long version; @CreatedDate private Date createdAt; @LastModifiedDate private Date modifiedAt; } 其中 @Id @Version是生效的 解决 普通数据源 在 Application 加上
翟凤玺
2022-05-25
1.2K0
报错:Clean & maintainable test code requires zero unnecessary code.
报错 org.mockito.exceptions.misusing.UnnecessaryStubbingException: Unnecessary stubbings detected in test class: XXXTest Clean & maintainable test code requires zero unnecessary code. Following stubbings are unnecessary (click to navigate to relevant line o
翟凤玺
2022-05-25
1.1K0
关于 Elasticsearch 429 Too Many Requests 的 排查思考
文章目录 导读 报错分析 如何看懂异常日志呢? 报错的猜想 生产情况分析 我个人认为合理的猜想 429报错怎么产生的? 查找资料 百度 elastic中文社区 书籍 github 关键资料总结 bulk 高IO (IO密集型) 高CPU(CPU密集型) es接收请求队列 es使用场景 我个人分析429产生的原因 429问题的进一步排查 更多的思考 最后 导读 最近线上有个关键报错: Wrapped by: java.io.IOException: Request POST https:/
翟凤玺
2022-05-12
2.1K0
No property b found on entity class com.xxx.A to bind constructor parameter to
报错 org.springframework.data.mapping.MappingException: No property b found on entity class com.xxx.A to bind constructor parameter to! 代码 @Data @SuperBuilder public class A extends Base { private String a; } @Data @SuperBuilder public class Base { privat
翟凤玺
2022-05-07
8580
‘org.springframework.data.mongodb.core.convert.MappingMongoConverter‘ that could not be found.
报错 *************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of constructor in org.springframework.data.mongodb.config.MongoAuditingRegistrar$MongoMappingContextLookup required a bean of type 'org.spring
翟凤玺
2022-05-07
1.3K0
A bean with that name has already been defined in file [xxx] and overriding is disabled.
报错 *************************** APPLICATION FAILED TO START *************************** Description: The bean 'xxx', defined in class path resource [xxx.class], could not be registered. A bean with that name has already been defined in file [xxx.class] an
翟凤玺
2022-05-07
1.2K0
MapStruct Unknown property “xx“ in result type XXX. Did you mean “null“?
build报错 Unknown property "xx" in result type XXX. Did you mean "null"? 解决办法 pom.xml <dependency>
翟凤玺
2022-05-07
2.1K0
报错:‘FeignRibbonClientAutoConfiguration‘ not loaded because @ConditionalOnClass did not find
报错信息 Description: Parameter 0 of method feignClient in com.xxx.config.FeignConfiguration required a bean of type 'org.springframework.cloud.openfeign.ribbon.CachingSpringLoadBalancerFactory' that could not be found. The following candidates were found bu
翟凤玺
2022-05-07
1.3K0
DBeaver使用
创建脚本页面 ctrl + ] 单sql执行 ctrl + enter 批量执行sql alt + x 格式化sql ctrl + shift + f 连接mysql时Public Key Retrieval is not allowed 📷
翟凤玺
2021-12-07
6460
一起学JVM(GC可视化工具Visual GC)
导读 众所周知,JVM(java虚拟机)运行着我们的java程序。java本身提供了自带工具VisualVM来帮助我们查看JVM的运行情况,下面主要介绍GC的可视化插件-Visual GC java版本 1.8.0_281 工具 VisualVM 的 Visual GC 插件 📷 面板解读 space 空间模块 Space — 空间主要描述空间的变化 Metaspace —  元空间 Old — 老年代 Eden — 伊甸园区 S0 — 存活0区 S1 — 存活1区 方框区:所占空间大小 空白区
翟凤玺
2021-12-07
1K0
idea调试多线程调用接口
导读 javaweb应用开发时,我们会对接口进行调试,往往都是对一次请求进行debug,但是接口的调用是多线程,我们可以通过一下方式,调试接口的并发请求。 方法 1. 设置断点为多线程断点 方式一 代码打上断点后,在断点上右键,选择Thread。 📷 方式二 Ctrl+Shift+F8,选择Thread。 📷 2. 多次调用接口 执行一步断点。(不执行一步只能看到一个线程) 查看debug控制台 📷 可以看到有多个线程都是RUNNING状态
翟凤玺
2021-12-07
1.3K0
idea - fatal: could not read Username for ‘https://gitee.com‘: No such device or address
导读 idea在git push代码的时候,控台报错 Invocation failed Server returned invalid Response. java.lang.RuntimeException: Invocation failed Server returned invalid Response. at org.jetbrains.git4idea.GitAppUtil.sendXmlRequest(GitAppUtil.java:22) at org.jetbrains.git4id
翟凤玺
2021-12-07
1.6K0
Linux报错:subprocess installed post-installation script returned error exit status 3
报错 中文版 > sudo apt-get upgrade ... Adding shortcut to the menu xdg-desktop-menu: No writable system menu directory found. dpkg: 处理软件包 redisplus (--configure)时出错: 已安装 redisplus 软件包 post-installation 脚本 子进程返回错误状态 3 在处理时有错误发生: redisplus E: Sub-process /usr/b
翟凤玺
2021-12-07
4560
点击加载更多
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档