google app engine - Key.create vs. ofy().load() -


i want key entity (i don't need actual entity. need key child entity).

so know there 2 ways of doing it:

// 1. key<thing> tkey = com.googlecode.objectify.key.create(thing.class, id);  // 2. key<thing> tkey = ofy().load().type(thing.class).id(id); 

what's difference between them? what's faster? 1 should use?

would answer change if had well:

thing t = tkey.get(); 

you want use key.create(thing, id).

ofy().load().type(thing.class).id(id) returns ref<thing>, not key<thing>. loads thing out of datastore, not want.


Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -