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); }
@Override public boolean equals(Object obj) { if (obj instanceof User) { User user = (User) obj; return user.getId() == id; } return false; }
public Long getId() { return user.getId(); }