ArrayList<Key> dataEntryKeys = new ArrayList<Key>();
Query query = new Query("Patient", KeyFactory.createKey("User", email));
query.setKeysOnly();
// Submit the query
PreparedQuery pq = datastore.prepare(query);
for (Entity result : pq.asIterable()) {
Key patients_key = result.getKey();
Query data_query = new Query("DataEntry", patients_key);
PreparedQuery dq = datastore.prepare(data_query);
for (Entity de : dq.asIterable()) {
dataEntryKeys.add(de.getKey());
}
}
return dataEntryKeys;
}