脱盐时的SerializationException com.google.appengine.api.datastore.Key GWT

时间:2013-05-17 14:51:35

标签: google-app-engine gwt jpa google-cloud-datastore datanucleus

我有一个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

任何帮助,提前致谢:)

1 个答案:

答案 0 :(得分:2)

尝试将custom GWT serialization用于User课程。

<强>更新

您可以尝试对KeyGWT with JDO problem

进行字符串编码