I have existing entity in datastore. I can find it Admin Console by attribute query e.g.:
SELECT * FROM UserEntry where email = '[email protected]'
and also query it by encoded key string, e.g.:
SELECT * FROM UserEntry where __key__ = KEY('cy1hcHByIAsSCVVzZXJFbnRyeM')
However, when I query the entity by unencoded key, it is not found:
SELECT * where __key__ = KEY('UserEntry','[email protected]')
From former queries I can verify that the key is correct and the same query works for other entities of the same type.
I experience the same behavior when I try to access the entity via JDO API:
pm.getObjectById(UserEntry.class, "[email protected]");
This code results in following exception:
javax.jdo.JDOObjectNotFoundException: Could not retrieve entity of kind UserEntry with key UserEntry("[email protected]")
How did this happen? How can I resolve this issue and avoid it in the future?