I'm using Objectify to save and load to Datastore.
When I save a object using:
ObjectDto newObjDto = new ObjectDto(/*some data*/);
ofy().save().entity(newObjDto).now();
Long newID = postDto.getId(); //new saved ID, field marked as @Id
Then I start immediately a task using newID
as task parameter, to do some operations about new object, but I cannot load from task:
Long obj_id = Long.parseLong(p_request.getParameter("obj_id"));
//obj_id is valid id
ObjectDto objDto = ofy().load().type(ObjectDto.class).id(obj_id).now();
//but at this point objDto = null .... why?
What I'm do wrong?
There is need to wait some time?
When you use @Parent, you get the object using ancestor.
https://code.google.com/p/objectify-appengine/wiki/AdvancedPatterns