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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -