예제 #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();
 }