I have a solution on this and can be found in the
Datastore Queries - an example of a query interface :
Query q = new Query("Person")
PreparedQuery pq = datastore.prepare(q);
for (Entity result : pq.asIterable()) {
String firstName = (String) result.getProperty("firstName");
String lastName = (String) result.getProperty("lastName");
Long height = (Long) result.getProperty("height");
System.out.println(lastName + " " + firstName + ", " + height.toString() + "inches tall");
}
I did not add a filter to the query, since it returned all entities from the data store.
source
share