Try new KeyFactory.Builder(parentKind, id).addChild(childKind, id).getKey ();
On Nov 16, 4:46 am, elvin <[email protected]> wrote: > Good day. > > As far as documentation states, "The key value includes the key of the > entity group parent (if any) and either the app-assigned string ID or > the system-generated numeric ID. To create the object with an app- > assigned string ID, you create the Key value with the ID and set the > field to the value. To create the object with a system-assigned > numeric ID, you leave the key field null." > > Is this the id that can be accessed via Key#getId() call? I assume it > is. > > My main question is: is this numeric ID guaranteed to be unique for > all entities of the same type? > > If yes, how do you retrieve the entity using this id? I tried using > PersistenceManager#getObjectById(), but it does not find my entity. I > guess this is related to the fact that my entity is child in an entity > group, thus its keys' string representation would not be "MyClass > (10)" (which is created when I use KeyFactory to create key from an > entity type and a numeric ID) but "MyParent(20)/MyClass(10)". > > Thanks in advance, > Evgeny. -- 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=.
