I have about 50 thousand objects stored in appengine. I can find a single entry through the GQL admin interface with a query like:
SELECT * FROM Pet where __key__ = KEY( 'Pet','Fido')
But it's hard for me to figure out how to make a batch version of this through JDO. Right now I have this:
PersistenceManager pm = ...;
for(Pet pet : pets) {
for(String k : getAllAliases(pet)) {
keys.add(KeyFactory.createKeyString(Pet.class.getSimpleName(), k));
}
}
Query q = pm.newQuery("select from " + Pet.class.getName() + " where id == :keys");
List<Pet> petlist = (List<Pet>) q.execute(keys);
But although "Fido" works in the case of GQL, it does not return anything when I use this Java + JDO code. What am I doing wrong?
source
share