Ejemplo n.º 1
0
 @Override
 @Transactional
 public void insert(Followers obj) throws UserNotFoundException, SQLServerException {
   try {
     followersDAO.getUser(obj.getFollowee().getUsername());
     try {
       followersDAO.checkExists(obj.getFollower().getUsername(), obj.getFollowee().getUsername());
       throw new EntryAlreadyExistsException();
     } catch (NoResultException e) {
       followersDAO.insert(obj);
     }
   } catch (NoResultException e) {
     throw new UserNotFoundException();
   }
 }
Ejemplo n.º 2
0
  @Transactional
  public void deleteRow(String follower, String followee) {

    followersDAO.getUser(followee);
    followersDAO.deleteRow(follower, followee);
  }