}
final boolean newRecord = (null == userEntity); // insert or update ?
if (newRecord) { // new user record to be inserted
userEntity = new UserEntity();
userEntity.setUserid(userid);
}
userEntity.setUsername(jsonEntity.getString("username"));
userEntity.setEmail(jsonEntity.getString("email"));
userEntity.setPassword(jsonEntity.getString("password"));