DBRefs(Mongo文档引用)没有急切地获取 [英] DBRefs (Mongo Document references) not fetched eagerly
问题描述
我在最简单的头像中使用Mongo(与Spring Data一起使用)。
I am using Mongo in its simplest avatar possible (in conjunction with Spring Data).
我有两个(第一类)实体(@Documents)A和B ,其中A的引用(@DBRef)为B。创建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.
I相信默认情况下会急切地提取DBRef(参见 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文档引用)没有急切地获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!