That's exactly what I was looking for. Thank you very much! :) Regards, Markus
On Aug 27, 2:55 am, "Ikai L (Google)" <ika...@google.com> wrote: > You might want to have a look at this: > > http://code.google.com/appengine/docs/java/javadoc/com/google/appengi..., > java.lang.String, long) > > You can specify a parent and allocate IDs. The only caveat is that these may > not be guaranteed to be sequential: just unique. > > > > > > On Wed, Aug 25, 2010 at 4:24 AM, markus <mar...@markuspetersen.dk> wrote: > > Hello all! > > > I have a datastore class "User", which has a property key of type Key > > as its primary key. > > > Now, I want to store objects of type "Result" in the datastore, as > > children of the User in an unowned relationship. Each result has a > > property key of type Key as its primary key as well. > > > For creating the key of the child, I currently use the > > Key.getChild(String kind, String name) method on the parent key (see > > >http://code.google.com/appengine/docs/java/javadoc/com/google/appengi... > > ), > > specifically like this: > > > Key key = user.getKey().getChild(Result.class.getSimpleName(), > > UUID.randomUUID().toString()); > > > The problem is, I'm quite sure that the UUID class doesn't guarantee > > uniqueness in a distributed setting like GAE. Is there a way to > > generate a unique name here, or preferably let the datastore handle > > uniqueness? Like a Key.getChild(String kind) method. > > > Regards, > > Markus > > > -- > > 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-j...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2B > > unsubscr...@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-appengine-java?hl=en. > > -- > Ikai Lan > Developer Programs Engineer, Google App Engine > Blog:http://googleappengine.blogspot.com > Twitter:http://twitter.com/app_engine > Reddit:http://www.reddit.com/r/appengine -- 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-j...@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.