List<Key> insertAutoId(Entity... entities) throws DatastoreException {
Mutation.Builder mutation = Mutation.newBuilder();
for (Entity entity : entities) {
mutation.addInsertAutoId(entity);
}
CommitRequest req = CommitRequest.newBuilder()
.setMutation(mutation)
.setMode(CommitRequest.Mode.NON_TRANSACTIONAL)
.build();
return datastore.commit(req).getMutationResult().getInsertAutoIdKeyList();
}