美文网首页
Spring JPA @NotFound(action=Not

Spring JPA @NotFound(action=Not

作者: 大继 | 来源:发表于2020-06-10 15:45 被阅读0次

前言

环境:java 11, spring boot 2.2.5
如题,在未加入@NotFound(action=NotFoundAction.IGNORE) 导致

java.util.NoSuchElementException: No value present

加入 @NotFound(action=NotFoundAction.IGNORE) 导致
fetch= FetchType.LAZY 失效,在查询的时候产生相关数据.

解决方法

删除关联表外建、注意看相关的id是否不存在.

image.png

相关文章

网友评论

      本文标题:Spring JPA @NotFound(action=Not

      本文链接:https://www.haomeiwen.com/subject/qkxptktx.html