I've ran into the same problem, except I'm on GAE-Python. I want to
use GeoModel on a large dataset. However, GeoModel uses "IN" queries,
which means it is incompatible with cursors. Therefore, if I want to
use GeoModel on very large datasets without it crapping out (or
arbitrarily limiting the results), you're out of luck.

However, I wrote a work-around to this. It isn't perfect, but it get's
the job done.

https://www.sugarsync.com/pf/D62078_717350_6916872

On Dec 22, 12:59 am, Glenn <[email protected]> wrote:
> I'm trying to find a workaround for some query cursor limitations.
> Say that I have entities with date and an value which is a
> multiple of ten from 0 to 100.
>
> I need to get paginated entities sorted by date and with the
> integer field above a given threshold, along the lines of the
> pseudo code:
>
> SELECT * FROM entity WHERE integer >= 50 ORDER BY date DESC
>
> What's the best way to do this?  My thoughts are below.
>
> As the docs say, I can't use an inequality on the integer field
> since then I'd have to sort by the integer first.  Instead of using
> integer values, I though Icould use strings: '0', '10', '20', etc.,
> and
> then use a query like this to get entities with a value of 70 or more:
>
> SELECT * FROM entity WHERE integer IN [70,80,90] ORDER BY date DESC
>
> But as the docs say, cursors can't be obtained from queries for
> entities that use contains() (i.e., IN) or even disjunctions
> (value == '70' || value == '80'...).
>
> My question is would a multiple value property (a list) work for
> this?  My idea is to set the all the values up to the true entity
> value, e.g., if the entity value was '40', then the MVP would be
> ['0', '10', '20', '30', '40'].  Then if the threshold was 20,
> then entities such as this would (I believe) be returned by a query
> like
>
> SELECT * FROM entity WHERE value == '20' ORDER BY date DESC
>
> Can you obtain a cursor from such a query or is there a better way?
>
> Thanks,
> Glenn

-- 
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.

Reply via email to