我有一个RPC-Call:
@Override
public void onSuccess(Void result) {
Window.alert("SuccessElse");
userService.getUser("103419018118650635943", new AsyncCallback<User>() {
@Override
public void onFailure(Throwable e) {
Window.alert("FailAgain");
e.printStackTrace();
}
@Override
public void onSuccess(User result) {
Window.alert(user.getEmail());
}
});
}
User
是:
@Entity
public class User implements IsSerializable {
@Id
@Column(name="id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key id;
private String googleID;
private String firstName;
private String lastName;
private String password;
private String gender;
private String email;
@OneToOne(cascade={CascadeType.ALL})
@JoinColumn(name="key")
private AuthenticationToken token=new AuthenticationToken();
private String pictureStringURL;
private String googlePlusProfileURL;
private String defaultLanguage;
// Lots of Sets and Gets }
名为getUser(String googleID)
的方法:
public User getUser(String googleId){
EntityManager em = emfInstance.createEntityManager();
Query q = em
.createQuery("select u from User u where u.googleID=:googleId");
q.setParameter("googleId", googleId);
return (User) q.getResultList().get(0);
}
然后我发现我的自我面对如何在客户端无法反序列化密钥<{1}}
Exception
任何帮助,提前致谢:)
答案 0 :(得分:2)