3
votes

Can anyone confirm if the AppEngine Datastore - using its Java API - supports a list of embedded entities? Something like

Entity parent = new Entity("Parent");
// set parent properties...
List<EmbeddedEntity> children = new ArrayList<EmbeddedEntity>();
for (int i = 0; i < 5; i++) {
  EmbeddedEntity child = new EmbeddedEntity();
  // set child properties...
  children.add(child);
}
parent.setUnindexedProperty("children", children);
DatastoreServiceFactory.getDatastoreService().put(parent);

It seems to work but

  1. it's not documented anywhere in the Entities, Properties, and Keys page
  2. in the Datastore Viewer the children field value always shows up as ["jj
1

1 Answers

0
votes

You can store a List (as Entity field) into the Datastore as long as the Object inside the List complies with the GAE Support types.

That includes EmbeddedEntity