【发布时间】:2016-06-27 12:27:37
【问题描述】:
我在 App 引擎端点中创建了一个实体,其中 Hashmap 作为一个属性。我正在使用 Objectify 进行持久性。我已经成功地为 android 生成了客户端库。但是当我试图在 android 中使用它时,它不是接受我的 hashmap,而是要求 JsonMap。实体类中是否允许使用 Hashmap?如果是,我应该如何使用云端点访问或保存它。
@Entity
public class MyData {
@Id
Long id;
HashMap<String, Object> userInfo;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public HashMap<String, Object> getUserInfo() {
return userInfo;
}
public void setUserInfo(HashMap<String, Object> userInfo) {
this.userInfo = new HashMap<>(userInfo);
}
}
【问题讨论】:
标签: java android google-app-engine google-cloud-endpoints objectify