Thursday, January 12, 2012

RequestFactory: Get entity ID on success of persist

Hi,
I am using following code.

Note:
request is of type ? extends RequestContext
entity is of type ? extends EntityProxy

(request).persist().using(entity).fire(
new Receiver<Void>() {
@Override
public void onSuccess(Void unUsed) {
I need the entity ID generated in the DB here.
If I do entity.getId(); it returns null obviously.
As I don't know the ID here, I can't even refetch the persisted
entity.
The Receiver should have received the updated entity as arg to its
onSuccess.
}

});

How do I do it?

Thanks,
Tapomay.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment