Hi,
I have the following data model:
class StadiumOccupant {
String stadiumname;
String username;
}
class Friend {
String username;
String friendname;
}
I want to find all users at a stadium that are also my friends. I can do that like this:
List<String> friendsAtStadium;
String stadiumId = 'xyz';
List<Friend> friends = select from Friend where username = 'me';
for (Friend friend : friends) {
List<StadiumOccupant> friendAtStadium =
select from StadiumOccupant where
stadiumname = stadiumId and
username = friend.friendname;
friendsAtStadium.addAll(friendAtStadium);
}
This can work with a very small number of objects. As soon as a user has more than a handful of friends, this won't work. Is there a solution to this on app engine? I can't think of one that performs well.
Thanks
-------- Some sample data --------
Friend { john, tim }
Friend { john, mary }
Friend { mary, frank }
StadiumOccupant { abc, tim }
StadiumOccupant { abc, frank }
StadiumOccupant { abc, kim }
so if I am user 'john', my friends are: { tim, mary }. if I were to run the stadium query with stadiumname='abc' I should get back { tim }.