0
我在AppEngine中使用Objectify和JAva。我想模擬一個多對多的關係,其中分辨率實體有額外的字段,如下面Objectify/AppEngine/Java:多關係
@Entity
public class Account {
public @Id Long id;
public String name;
}
@Entity
public class Baby {
@Id public Long id;
public String name;
}
@Entity
public class AccountBaby {
public @Id Long id;
@Index
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Ref<Account> account;
@Index
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Ref<Baby> baby;
public int permission;
}
如果我遵循這個模式,我無法查詢帳戶的名單給寶寶的ID(或嬰兒的列表針對指定帳戶的ID),如下
List<AccountBaby> babies = OfyService.ofy().load().type(AccountBaby.class).filter("account=",
Key.create(Account.class, accountId)).list();
查詢是他們任何其他方式查詢或模擬這種關係?