If you're using the method of obtaining the EntityManager that Google
suggest in:
http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html
i.e.
public static final EntityManager entityManager() {
return EMF.get().createEntityManager();
}
This won't work. RequestFactory will be obtaining the Child and Parent
objects from different EntityManagers (yep total pain I know).
This means your Child proxies will have had their properties set in
different instances in a different EntityManager which you won't be
able to see.
I got round this by writing a ServiceLayerDecorator that obtains
EntityManagers via Guice persist, but there are probably simpler
methods.
Personally I think the RF documentation is very misleading - it states
"Changes to related entities can be persisted in a single request."
Yes, if you completely change the default behaviour of RF + JPA with
significant difficulty.
See:
http://code.google.com/p/google-web-toolkit/issues/detail?id=5389
http://code.google.com/p/google-web-toolkit/issues/detail?id=5724
http://code.google.com/p/google-web-toolkit/issues/detail?id=5776
Have fun,
Will
On Apr 4, 5:35 pm, Thomas Broyer <[email protected]> wrote:
> Most likely the properties for the children will be set *after* the children
> have been given to their parent; something like:
>
> 1. create parent
> 2. create child A
> 3. create child B
> 4. set parent properties (including "empty" children objects A and B)
> 5. set child A properties
> 6. set child B properties
>
> What matters is what your service method receives as argument. But yes, it
> means your setChildren() in the parent object cannot make a copy of the
> children objects (it can make a shallow copy of the list though) or rely on
> any of their properties.
--
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.