public void upgradeLevels() { List<User> users = userDao.getAll(); for (User user : users) { if (canUpgradeLevel(user)) { upgradeLevel(user); } } }
protected void upgradeLevel(User user) { user.upgradeLevel(); userDao.update(user); sendUpgradeEMail(user); }
public void add(User user) { if (user.getLevel() == null) user.setLevel(Level.BASIC); userDao.add(user); }