문제

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