示例#1
0
  public void updateUser(User user) {

    User userToUpdate = getUser(user.getId());
    userToUpdate.setName(user.getName());
    userToUpdate.setAge(user.getAge());
    userToUpdate.setIsAdmin(user.getIsAdmin());
    getCurrentSession().update(userToUpdate);
  }
示例#2
0
  @Override
  public boolean equals(Object obj) {
    if (obj instanceof User) {
      User user = (User) obj;
      return user.getId() == id;
    }

    return false;
  }
示例#3
0
 public Long getId() {
   return user.getId();
 }