我正在开发一个Android应用程序,每当用户启动此应用程序时,它将生成一个新的注册表(如果不存在),在更新现有数据时,我的应用程序将在用户节点中插入更多信息.
每次更新此节点时,所有其他信息都将丢失.
我的用户类
@IgnoreExtraProperties
public class User {
public String userID;
public String userName;
public String userMail;
public boolean active;
public User() {}
public User(String userID, String userName) {
this.userID = userID;
this.userName = userName;
}
public User(String userID, String userName, String userMail, boolean active) {
this.userID = userID;
this.userName = userName;
this.userMail = userMail;
this.active = active;
}
@Exclude
public Map<String, Object> toMap() {
HashMap<String, Object> result = new HashMap<>();
result.put("user_id", userID);
result.put("name", userName);
result.put("email", userMail);
result.put("active", active);
return …
Run Code Online (Sandbox Code Playgroud)