@Transactional
  public String createUser(User user) {
    if (user.getEmail() != null) {
      user.setPassword(createHash(user.getPassword()));
      user.fullyEnable();

      userDAO.saveUser(user);

      user.getInvite().setStatus(InviteStatus.USED);
      user.getInvite().setDateUpdated(new DateTime());

      userDAO.updateInvite(user.getInvite());
    }
    return "success";
  }
 @Transactional
 public List<User> listUsers() {
   return userDAO.listUsers();
 }
 @Transactional
 public Role getRole(String name) {
   return userDAO.getRole(name);
 }
 @Transactional
 public User getUserById(Long userId) {
   return userDAO.getUserById(userId);
 }
 @Transactional
 public User getUser(String email) {
   return userDAO.getUser(email);
 }
 @Transactional
 public void saveOrUpdateUser(User user) {
   userDAO.saveOrUpdateUser(user);
 }
 @Transactional
 public void followUser(User user, User toFollow) {
   userDAO.followUser(user, toFollow);
 }
 @Transactional
 public void unfollowUser(User user, User toUnfollow) {
   userDAO.unfollowUser(user, toUnfollow);
 }
 @Transactional
 public PasswordResetRequest getPasswordResetRequest(String code) {
   return userDAO.getPasswordResetRequest(code);
 }
 @Transactional
 public void updatePassword(User user, String password) {
   user.setPassword(createHash(password));
   userDAO.saveOrUpdateUser(user);
 }
 @Transactional
 public void addPasswordResetRequest(PasswordResetRequest request) {
   userDAO.addPasswordResetRequest(request);
 }
 @Transactional
 public Invite getInvite(String code) {
   return userDAO.getInvite(code);
 }
 @Transactional
 public void updateInvite(Invite invite) {
   userDAO.updateInvite(invite);
 }
 @Transactional
 public void addInvite(Invite invite) {
   userDAO.addInvite(invite);
 }
 @Transactional
 public List<User> listUsersExcept(User user) {
   return userDAO.listUsersExcept(user);
 }