I asked a design question about EntityProxy and ValueProxy (http://
groups.google.com/group/google-web-toolkit/browse_thread/thread/
894718c982b5a149).
Now, I have similar question about EntityProxies for entity groups. I
have a 1:1 mapping of two entities: E1 and E2. E2 is a child of E1
( App Engine Entity hierarchy thing ).
When I use RequestFactory to update E1, both E1 and E2 are sent over
to the server, but E2 have two copies on the server! One is the child
of E1, the other is fetched directly from the database by
RequestFactory. When E1 is saved, the update on E2 is lost because the
update is applied to the other one.
My design to solve the issue is:
public interface MyEntityGroupRequest extends RequestContext {
Request<MyE1Proxy> getMyE1();
// instead of doing this:
Request<Void> persist(MyE1Proxy one);
// I use this prototype:
Request<Void> persist(MyE1Proxy one, MyE2Proxy two);
}
On the client side I call:
edit_request.persist(edit_response /* e1 proxy
*/,
edit_response.getE2() );
instead of:
edit_request.persist(edit_response /* e1 proxy
*/);
Is there a better way to solve it?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.