Monday, August 24, 2015

Re: RequestFactory - update entity

The following solved my problem:

request = AppManager.getRequestFactory().personRequest();
object = request.edit(object); //object is the Proxy passed to me
// request.edit(object); // instead of this...

Actually edit(object) returns a new "mutable version" of the entityProxy, that can be worked with. Changing values and persisting did not cause exceptions anymore.

Am Montag, 24. August 2015 21:10:30 UTC+2 schrieb Manuel:
Hi everyone,

Im using the requestFactory and want to update an entity. The problem is, its frozen.

I get an entityProxy passed, were I like to update 1 value. The problem is, when I try to edit it with a new Request, it fails, cause the proxy is frozen.

I found this:

It says, I got to get a new entityProxy from the server.

This would take 1 request to receive a "fresh" entityProxy and another for the update... I was wondering, if there is a better way to do this? Or whats the proper way to update a entity with just 1 request?
Is there a way to actually create a new entityProxy on the client that updates an existing entity without loading it from the server?

Thats what I tried:
               PersonRequest request = AppManager.getRequestFactory().personRequest();
PersonProxy proxy = request.create(PersonProxy.class);

.setId(object.getId()); // Copy values of passed object
.persist(proxy).fire(new Receiver<PersonProxy>()

Copy all values ends in hibernate Exception for detached entity passed to persist.

Thanks in advance.


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

No comments:

Post a Comment