Since there is no way to join tables using Google App Engine datastore, I loop over a list of entities and look up the related entities one-by-one using the foreign key value.
for (Employee staff: staffList){
Employee manager = pm.getObjectById(Employee.class, staff.getManagerId());
}
There is a good chance that I will be needing the same referenced entity more than once, and I do not want to go to the datastore twice for the same entity.
Is there some kind of session cache that I can enable to eliminate the duplicate lookups, or do I have to roll my own?