views:

36

answers:

1

I would like to do a batch put of entities with pre-defined keys using the low-level api for Java.

You can do a batch get:

 Map<Key,Entity> get(.Iterable<Key> keys) 

However the batch puts all seem to want to allocate their own keys:

List<Key> put(Iterable<Entity> entities)

Documentation page: http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreService.html#put(java.lang.Iterable)

I'm trying to batch get on a collection of entities, update them, and then batch put them back into the datastore. It makes sense that I should be able to do this without changing the values of their keys, doesn't it?

A: 

Looks like I brain farted by posting this question, but maybe this will help someone else in the future. All you have to do is set the keys when you allocate the entities:

Entity entity = new Entity(key);

Or if you had previously pulled the entities from the datastore, the keys should already be set.

DutrowLLC