Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all entity kinds from GAE server?

How can I get all entity kinds from GAE server? Is this possible? I want to make a DB manager tool for GAE.

like image 469
eonil Avatar asked Jan 27 '26 15:01

eonil


1 Answers

You can use the Metadata API. For example:

Query query = new Query(Entities.KIND_METADATA_KIND);
DatastoreService datastoreService = DatastoreServiceFactory.getDatastoreService();

Iterable<Entity> entityIterable = datastoreService.prepare(query).asIterable();

for(Entity entity : entityIterable) {
    System.out.println("Entity kind: " + entity.getKey().getName());
}
like image 154
spg Avatar answered Jan 29 '26 11:01

spg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!