Chris, thank you for the link! The document states: "As of GWT version
2.0, some common forms of persistence are now handled by the GWT RPC
mechanism. GWT considers a class to be enhanced if any of the
following are true: (...) The class is annotated with a JPA
javax.persistence.Entity annotation."

I'm not sure this really means that the JPA 2 annotated entities have
to be enhanced to be serializable. If such an entity is created on the
client and then sent to the server to be persisted, it's not enhanced
of course. And this also can cause funny errors:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/b9237c5638b68a04/c6d888a1ac444d28

For unenhancing the entities I used the Hibernate3BeanReplicator of
the beanlib library. With it it's possible to configure a whitelist of
classes and attributes which should be serialized to the client. So
additional confidental information in the domain model would not be
harmful. The problem would rather be the deserialization (sending the
objects back to the server): Then one has to do some kind of merging
where the information which was'nt sent to the client must be loaded
from the database and the rest is overwritten from the data received
from the client. afaik this kind of merging cannot be done
automatically with the beanlib. Considering this, it's really best to
use data transfer objects, thus making the information which is sent
to the client more explicit.

I thought this was a technical problem, but it turns out to be
conceptional / architectural :-)

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