Hi Ken. This is a known issue -- one-to-many owned relationships of the same kind aren't persisted correctly. We do plan to address this particular issue in a forthcoming update. In the meantime though, you can look into using unowned relationships (list of keys) instead which should work.
- Jason On Thu, Sep 10, 2009 at 9:23 AM, Ken <kenot...@gmail.com> wrote: > > I have a JDO class representing a tree of entities, somewhat like > this: > > public class TreeNode { > private String nodeName; > private List<TreeNode> children; > ... > } > > When I persist any such node to the datastore, the insert fails > silently. The key of the object returned from makePersistent is null, > and no entities reside in the data viewer. > > However, If I remove the 'children' field, or replace it with a list > of keys, then objects may be persisted, but I get a chicken-and-egg > problem when trying to create the entity key relationship, as the > child key is not available until its entity is persisted, which means > I cannot set the parent key on the child key after it has been > persisted. > > Is this the expected behavior of the datastore? Are classes w/ fields > of the same type allowed? How would one persist a tree otherwise, > maintaining proper entity key parent/child relationships to ensure the > whole tree is available in a transaction? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---