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 <[email protected]> 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 [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.