The best example I could find was:
// Get a handle on the datastore itself
DatastoreService datastore =
DatastoreServiceFactory.getDatastoreService();
// Lookup data by known key name
Entity userEntity = datastore.get(KeyFactory.createKey("UserInfo",
email));
// Or perform a query
Query query = new Query("Task", userEntity);
query.addFilter("dueDate", Query.FilterOperator.LESS_THAN, today);
for (Entity taskEntity : datastore.prepare(query).asIterable()) {
if ("done".equals(taskEntity.getProperty("status"))) {
datastore.delete(taskEntity);
} else {
taskEntity.setProperty("status", "overdue");
datastore.put(taskEntity);
}
But is 1 datastore factory ok or should I create different ones?
On Sep 24, 11:21 am, iker98 <[email protected]> wrote:
> +1, I agree with this approach.
>
> I like the great flexibility and control that the low-level API gives
> me.
>
> I would like documentation about low-level API programming.The API is
> very simple but I have some doubts.
> For example, It is not necessary to close the DatastoreService after
> using? It's very confortable but it seems odd.
>
> Thanks
>
> On Sep 23, 11:40 am, dflorey <[email protected]> wrote:
>
>
>
> > I've just refactored my app to use Low-Level API instead of JDO and
> > it's much cleaner, works more reliable etc.
> > If you are not really forced to use JDO/JPA I'd strongly recommend to
> > use the very simple, elegant and clean Low-Level API.
> > BigTable simply is not a relational db, so it is highly misleading to
> > fake a relational wrapper and to me it caused lots of pain.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---