问题描述
我在最简单的化身中使用 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 文档引用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)