I am trying to retrieve an entity from my database using its id.
I've tried using all kind of commands but the result stays the same , I always get an empty entity. I know the id is correct because I run a query on my database and receive this id.
this is how i receive the id from my database
Object course = courseList.get(0).getKey().getId();
I tried creating a key from that id and use
Key key = KeyFactory.createKey("courses", course);
db.get(key);
even tried run a query on database with that key.I can see the the query is correct but I still receive an empty entity:
Query query = new Query("Courses").setFilter(Query.FilterOperator.EQUAL.of(Entity.KEY_RESERVED_PROPERTY, key));
and also like that
Query query = new Query("Courses").setFilter(Query.FilterOperator.EQUAL.of("__Key__", key));
I'm out of ideas ... what am I doing wrong? I know for sure this key exist.In debug mode I can see this key.I see it also in my database. thanks