On Friday, December 31, 2010 12:18:44 AM UTC+1, Simon Majou wrote:
I am using GAE and when I create an entity having parents with Request Factory, I get this exception:com.googlecode.objectify.NotFoundException: No entity was found matching the key: Key{kindClassName=com.pipo. MyEntity, parent=null, id=2} This exception is launched when calling:public static MyEntity findMyEntity(Long id) { return ObjectifyService.begin().get(MyEntity.class, id); }Obviously the parent ID is missing from this method. But requestfactory requires this method with this exact signature ...
Actually, not at all!
RequestFactory mandates (if you're not using a locator) that you have a static findMyEntity method that returns a MyEntity instance and takes as argument an ID for MyEntity.
I don't know Objectify but from the little I saw in the javadoc, your ID would have to be a Key<?> if you want the parent relationship, and not a Long. This means your getId accessor would have to return a Key too. It also means you have to map the Key class to a ValueProxy (same as EntityProxy but without the getId/getVersion/findXxx constraints).
So I think I need to inject by myself the parent id into that method.To do that I should use the ServiceLayer API right ?
No.
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment