DBRefs (Mongo Document references) not fetched eagerly(未急切获取 DBRefs(Mongo 文档引用))
问题描述
我在最简单的化身中使用 Mongo(结合 Spring Data).
I am using Mongo in its simplest avatar possible (in conjunction with Spring Data).
我有两个(第一类)实体 (@Documents) A 和 B,其中 A 在其中包含 B 的引用 (@DBRef).创建 A 和 B 时一切正常.但是,当读取对象 A(按 Id)时,引用 B 始终为 null.
I have two (first class) entities (@Documents) A and B, where A has a reference (@DBRef) of B within it. Everything works fine when creating A and B. However, when reading object A (by Id), the reference B is always null.
我相信默认情况下会急切获取 DBRefs(请参阅 http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#mapping-usage-references),但目前的行为是反对.任何想法为什么?
I believe DBRefs are eagerly fetched by default (see http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#mapping-usage-references), but the behavior currently is against that. Any ideas why?
推荐答案
迁移到 Spring Data Mongo M5 构建解决了这个问题.所以,在那之前一定是个bug.
Moving over to the Spring Data Mongo M5 build resolved this. So, must be a bug until then.
这篇关于未急切获取 DBRefs(Mongo 文档引用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:未急切获取 DBRefs(Mongo 文档引用)
- 如何使用WebFilter实现授权头检查 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
