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 文档引用)


基础教程推荐
- 大摇大摆的枚举 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01