Thursday, December 29, 2011

Re: Serializing and Deserializing EntityProxy with created EntityProxy inside makes root EntityProxy have created EntityProxy's stableId

There's a line missing between the "String data = " and the incorrect
pasted line "PersonProxy item =".

For my example it should read:
store = new DefaultProxyStore(data); //Recreate store from serialized
TestRootProxy item =
id); //Deserialize it to the original Proxy.

And in production this would be read either from client-side storage
or through a call to the server to get the serialized string instead
of in one flow. But it behaves the same either way.

On Dec 29, 11:16 am, Kevin Jordan <> wrote:
> Simple case in case my wording was a little confusing:
> TestRootProxy rootProxy =
> requestContext.create(TestRootProxy.class); //Doesn't matter if it's a
> loaded one or an unpersisted root
> rootProxy.setChild(requestContext.create(TestChildProxy.class));
> DefaultProxyStore store = new DefaultProxyStore();
> ProxySerializer serializer = requestFactory.getSerializer(store);
> String id = serializer.serialize(rootProxy);
> String data = store.encode();
> PersonProxy item =
> DesktopEntryPoint.REQUEST_FACTORY.getSerializer(store).deserialize(TestRoot Proxy.class,
> id);
> requestContext = requestFactory.testRootRequest();
>"Root stableId: " +
> EntityProxyCategory.stableId(AutoBeanUtils.getAutoBean(item))); //This
> will print out the same stable id as below.
>"Child stableId: " +
> EntityProxyCategory.stableId(AutoBeanUtils.getAutoBean(item.getChild())));
> item = requestContext.edit(item);
> item.getChild(); //This will throw a classcastexception as child is
> overwritten now to be pointing to the TestRootProxy.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment