我是Google App Engine的新用户,我正在阅读此页面: https://developers.google.com/appengine/docs/java/datastore/queries
这里他们已经解释了如何从dataStore中检索数据:
// Get the Datastore Service
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
// The Query interface assembles a query
Query q = new Query("Person");
//Use CompositeFilter to set more than one filter
q.setFilter(CompositeFilterOperator.and(
new FilterPredicate("lastName", Query.FilterOperator.EQUAL, lastNameParam),
new FilterPredicate("height", Query.FilterOperator.LESS_THAN, maxHeightParam)));
// PreparedQuery contains the methods for fetching query results
// from the Datastore
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(firstName + " " + lastName + ", " + height + " inches tall");
}
但是如何保存这些data.where以及如何在DataStore中保存firstName和LastName?
由于