Пример #1
0
  public List<UserFans> getUserFanses() {
    List<UserFans> ufs1 = new ArrayList<UserFans>();
    List<UserFans> ufs2 = new ArrayList<UserFans>();
    for (UserFans uf : userFanses) {
      uf.setUserLiving(false);
      PersonalOnlive po = personalOnliveDao.findOnlivingByUser(uf.getUser().getId());
      if (po != null) {
        uf.setUserLiving(true);
        uf.setPersonalOnliveID(po.getId());
        ufs1.add(uf);
      } else {
        ufs2.add(uf);
      }
    }
    for (UserFans uf : ufs2) {
      ufs1.add(uf);
    }

    return ufs1;
  }
 public void initWithHostData(PersonalOnlive personalOnlive, BaseUser user) {
   this.setUserName(Utils.getEmptyString(user.getNickName()));
   this.setUserID(Utils.getEmptyString(user.getId().toString()));
   this.setOnliveID(personalOnlive.getId().toString());
 }