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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---