简体   繁体   English

在Objectify中由多个祖先查询

[英]Query by Multiple ancestors in Objectify

Is it possible to load() entities from multiple ancestor. 是否可以从多个祖先load()实体。
I have two Kinds 1- user, 2- post User is ancestor of post 我有两个Kinds 1-用户,2-交用户是ancestor后的

I know how to apply ancestor query for single user like this ofy().load().type(Post.class).ancestor(user1).list(); 我知道如何对这样的单用户应用祖先查询ofy().load().type(Post.class).ancestor(user1).list();
But how can apply query for multiple ancestors ? 但是如何查询多个祖先呢?
Maybe something like this 也许像这样
ofy().load().type(Car.class).ancestors(user1,user2).list();

Is it possible how can I do that if not what I do to achieve this ? 如果没有实现该目标,我该怎么做?

It is not possible. 这不可能。 Datastore not supports multi ancestor queries as well as OR operator. 数据存储区不支持多祖先查询以及OR运算符。 You will need to make two separate queries for that. 您将需要为此进行两个单独的查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM