@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(); } }
@Transactional public void deleteRow(String follower, String followee) { followersDAO.getUser(followee); followersDAO.deleteRow(follower, followee); }