سؤال

Calling Objectify method: Key.create(ParentClass.class parentClass, KindClass.class kindClass, String id)

for the exactly same parameters twice at the same time, I got: name=UWxoCs7KpxDu2fYBI3s2fkOq-wM name=jOqQzhZzAScJ0O3OEtYF3jzb34Q

Does this method need to run in a transaction so I get a predictable result?

هل كانت مفيدة؟

المحلول

The app id and namespace are also encoded in the key. You can see the components that represent a stable key here:

https://code.google.com/p/googleappengine/source/browse/trunk/java/src/main/com/google/appengine/api/datastore/Key.java

نصائح أخرى

I cannot find any reference to an Objectify Key.createKey method. Which version of Objectify are you using?

There is however a Key.create(Key<?> parent, java.lang.Class<? extends T> kindClass, java.lang.String name), trying using that and let us know how you get on.

Here is the API page for Key https://objectify-appengine.googlecode.com/svn/trunk/javadoc/com/googlecode/objectify/Key.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top