Google app engine 对象化引用中引用列表上的筛选器

Google app engine 对象化引用中引用列表上的筛选器,google-app-engine,google-cloud-datastore,objectify,Google App Engine,Google Cloud Datastore,Objectify,我将GAE与Objectify一起使用,其实体如下: @Entity class LevelOne { @Id Long id; @Index @Load Ref<LevelTwo> two; } @Entity class LevelTwo { @Id Long id; @Index List<Ref<LevelThree>> threes; } @Entity class Leve

我将GAE与Objectify一起使用,其实体如下:

@Entity
class LevelOne {
    @Id
    Long id;
    @Index
    @Load
    Ref<LevelTwo> two;
}

@Entity
class LevelTwo {
    @Id
    Long id;
    @Index
    List<Ref<LevelThree>> threes;
}

@Entity
class LevelThree {
    @Id
    Long id;
}

但我没有得到任何结果。我从维基上的文档中了解到,如果我不使用
Ref
s并嵌入完整的实体,我应该期待结果,但是冗余会变得可怕

谷歌应用程序引擎的数据存储不执行连接<代码>参考s是对外国实体的关键参考。您不能跨引用进行筛选

但是,您可以在LevelOne对象中创建一个合成索引字段,并用您想要的任何数据(包括其他实体中的数据)填充它(可能是在@OnSave方法中)。然而,与一般的非规范化一样,您必须小心数据的更新方式

ofy().load().type(LevelOne.class).filter("two.threes", keyOfThree).list();