Hi,

If a class has a list property, is there any legitimate or hackish way
in app engine to get the matched elements? For example:

    class ParkingLot {
        String parkingLotId;
        List<String> cars;
    }

    ParkingLot p = new ParkingLot();
    p.parkingLotId = "abc";
    p.cars.add("ford_john");
    p.cars.add("ford_mary");
    p.cars.add("honda_tim");
    p.cars.add("toyota_kim");

    // Find all cars in the parking lot that are fords,
    // then get their owners.
    Query q = "select from ParkingLot where parkingLotId = 'abc'";
    query.setFilter("cars.matches(" + "'" + "ford" + "%')");

    // Right now this will return all ParkingLot instances
    // that matched, but instead would want the actual String
    // instanced of the List object that matched:
    List<String> results = q.execute();
    // results[0] = "ford_john"
    // results[1] = "ford_mary"

Yeah I don't know if the partial string match would work on the list
property values, and also am pretty sure we can't get back the matched
string values.

Right now I need to write out a single CarAtParkingLot entity to do
the same select:

    class CarAtParkingLot {
        String parkingLotId;
        String carType;
        String carOwner;
    }

    select CarAtParkingLot where parkingLotId = 'abc' and carType =
'ford';

which will require a lot more storage, if I am understanding the
storage model correctly. I have hundreds of thousands of cars at a
given parking lot. I know a list property can only hold 5000 entities
at once, and cars leaving parking lots is a performance concern, just
wondering what options we have here,

Thanks

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