0

How can I get a list of all namespaces from the GAE datastore using objectify?

I have found the implementation by google in here:

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.Entities;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Query;


void printAllNamespaces(DatastoreService ds, PrintWriter writer) {

  Query q = new Query(Entities.NAMESPACE_METADATA_KIND);

  for (Entity e : ds.prepare(q).asIterable()) {
    // A nonzero numeric id denotes the default namespace;
    // see Namespace Queries, below
    if (e.getKey().getId() != 0) {
      writer.println("<default>");
    } else {
      writer.println(e.getKey().getName());
    }
  } 

I couldn't find any way to use it with objectify . Does anyone knows such a way? or is it not yet implemented.

1 Answer 1

0

That can't be done for now with the objectify framework. a discussion was opened in google groups

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.