When an instance is create()d on the client, it has no ID, so when sent to 
the server, it create()s it there too.

If an instance was first retrieved from the server, its ID has been sent to 
the client (serialized as part of the stableId() of the EntityProxy), so 
when sent back to the server, it find()s it by its ID (deserialized from the 
"stable ID").

Then, just before sending the result to the client, the server asks for each 
entity it has seen (as input or output) if it still "isLive()"; if it is 
not, it means the entity has been deleted. If it is, and the entity was sent 
in the request, it then checks the current version against the one sent by 
the client as part of the request, to determine if the entity has been 
updated. If the entity was create()d on the client, and isLive(), then it 
means it has been persisted.

Both the ID and version are always sent to the client, whether you expose 
them as properties in your EntityProxy or not (and if you do, they are in no 
way "bound" to the one known, and used, by RequestFactory; i.e. a setId() on 
an EntityProxy won't change its ID, as used to determine whether create() or 
find() should be called on the locator, and which value will be passed to 
find() if need be); they are "metadata", not "data".

-- 
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.

Reply via email to