public boolean addUser(User user) { boolean result = add( "INSERT INTO " + getTableName() + " VALUES('" + user.getLoginname() + "'," + "'" + user.getUsername() + "','" + user.getPassword() + "','" + user.getRepassword() + "'," + "'" + user.getAge() + "','" + user.getGender() + "','" + user.getID() + "'," + "'" + user.getAddress() + "','" + user.getTelephone() + "')"); return result; }
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); }