Hi,

I´ve come with a solution to a similar problem I had.

What I did was this:

Lets say you can have MAX 6 rooms, so, on one field you store the
actual number of rooms and in other a list of "room queries" que
entity fits:

I'll explain myself:

class Entity{
Long rooms;
ArrayList<Long> roomQueries;
}

Now you need a code for every possible query for a room range i.e.
"14" (from 1 to 4), "23" (from 2 to 3), "1" (exactly 1). Then you
calculate the ranges that fit your number of rooms and store them in
"roomQueries".

Having all this set, you can query with a equality filter
i.e .filter(roomQueries = 56).

Another way of implementing this (actually the one im using) is
assigning every "slot" a power of 2, then a range query would be the
sum of all "slots" values involved

Using the above case, you'd have

1 room -- > 1
2 rooms -- > 2
3 rooms -- > 4
4 rooms -- > 8
5 rooms -- > 16
6 rooms -- > 32

the the query for 2 to 3 rooms would be = 6, 2 to 5 = 30.. and so on.


Hope this can help you :)


On Sep 19, 2:11 am, "GAE-framework.googlecode.com"
<[email protected]> wrote:
> Hillo GAE developers!
>
> I have a serious situation with datastore. I need select data from
> model with multiple criteria. I have a House model, where exists
> fields: cost, rooms, floor. I need filter all houses, where cost >
> 50000 and < 150000, and also rooms > = 3 and < 5, and also floor >= 1
> and < 3.
>
> How can I select this dataset? As I see, the Datastore says that I can
> use filter criteria with >, <, >=, <= and != only on one column. But I
> reallly need use this rules on multiple columns.
>
> Please, help me!!!
> How to implement my task with Datastore limitations?
>
> Thank you. I really need your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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?hl=en.

Reply via email to