Wednesday, December 29, 2010

Re: Example to test RequestFactory in JRE

I tried to use the class  RequestFactoryMagic but I get the following exception:
java.lang.IllegalArgumentException: Attempting to edit an EntityProxy previously edited by another RequestContext

Here is my code:

 DomainRequestFactory rF = RequestFactoryMagic.create(DomainRequestFactory.class);
 UserProxy bob = rF.userRequest().create(UserProxy.class);
 String email = "bob@toto.org";
 bob.setEmail(email);
 rF.userRequest().persist().using(bob).fire();
 
 rF.userRequest().findByEmail(email).fire(new Receiver<UserProxy>() {
@Override
public void onSuccess(UserProxy user) {
assertNotNull(user);
}
 });

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