【问题标题】:Objectify filter on ref参考对象化过滤器
【发布时间】:2013-07-27 21:37:33
【问题描述】:

我想要两个实体

@Entity
public class User {
   @Index private String email;
   @Index private String name;
   @Index private String age;
     }
 @Entity
public class poll {
     @Index private String pollid;
     @Index private String answer;
     @Index private Ref<User> user;
    }

现在,如果我想通过电子邮件查询民意调查和过滤,我就空了。有可能吗?

ofy().load().type(Poll.class).filter("email", email).list();

【问题讨论】:

    标签: google-app-engine objectify


    【解决方案1】:

    您不能对 GAE 进行“间接”查询(例如,JOIN 类型的查询)。基本上,您的“投票”实体没有“电子邮件”字段。

    【讨论】:

    • 那么,如果我想使用电子邮件 ID 进行过滤,我应该采用哪种类型的结构。嵌入会有帮助吗?
    猜你喜欢
    • 2013-03-15
    • 2019-03-13
    • 1970-01-01
    • 2020-05-08
    • 1970-01-01
    • 2018-12-14
    • 2018-08-05
    • 2011-12-22
    • 2014-08-29
    相关资源
    最近更新 更多