Just what I needed. Thank you.

On Sep 6, 1:38 am, Sergio Lopes <slo...@gmail.com> wrote:
> I'm using the Datastore API to query __BlobInfo__ entity directly.
> In my case, for example, I can have multiple versions of the same
> filename but I need to get the last one.
> So:
>
>  Query query = new Query("__BlobInfo__");
>  query.addFilter("filename", FilterOperator.EQUAL, filename);
>  query.addSort("creation", SortDirection.DESCENDING);
>
>  DatastoreService datastore =
> DatastoreServiceFactory.getDatastoreService();
>  PreparedQuery pq = datastore.prepare(query);
>  List<Entity> entList = pq.asList(FetchOptions.Builder.withLimit(1));
>
> Hope that helps...
>
> On 6 set, 05:13, Peter Liu <tinyee...@gmail.com> wrote:
>
> > Hi all,
>
> > Anyone know a simple way to query BlobInfo?
>
> > Simple use case will be query the BlobInfo that has a specific file
> > name.
>
> > It seems there's a method to query BlobInfo for Python but I can't
> > find it for java.
>
> > Thanks!

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to