MountainClimb / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

Key kind is case sensitive -- incorrect example in the documentation #242

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to access a child entity with JDO.

Does not find the entity like this:

Key projectKey = KeyFactory.createKey(Project.class.getSimpleName(), pid);
Key groupKey = KeyFactory.createKey(projectKey, Group.class.getSimpleName(), 
gid);
Group g = pm.getObjectById(Group.class, groupKey);

The uppercase variant does work:
Key projectKey = 
KeyFactory.createKey(Project.class.getSimpleName().toUpperCase(), pid);
Key groupKey = KeyFactory.createKey(projectKey, 
Group.class.getSimpleName().toUpperCase(), gid);
Group g = pm.getObjectById(Group.class, groupKey);

According to 
http://code.google.com/appengine/docs/java/datastore/jdo/creatinggettinganddelet
ingdata.html it should work without the .toUpperCase() either, however it does 
not.

Original issue reported on code.google.com by testmail...@gmail.com on 24 Aug 2011 at 9:08

GoogleCodeExporter commented 8 years ago
Affected versions:
datanucleus-appengine: 1.0.9
datanucleus-core: 1.1.5

Original comment by testmail...@gmail.com on 24 Aug 2011 at 9:11

GoogleCodeExporter commented 8 years ago

Original comment by googleco...@yahoo.co.uk on 21 Sep 2011 at 3:52

GoogleCodeExporter commented 8 years ago
App Engine and the JDO implementation doesn't know anything about the case of 
the kind. If your code only works with toUpperCase() then that means you stored 
data where the kind is PROJECT and GROUP. Closing for now. If you can provide 
an example (including model classes) where you persist data and are then unable 
to retrieve it I'll be happy to investigate.

Original comment by max.r...@gmail.com on 27 Oct 2011 at 4:50