public static void insertOrUpdateURLRedirect(String url){
         Redirects redURL;
         EntityManager manager = JPUtil.getInstance().getManager();
        manager.getTransaction().begin();
        try {
              redURL  = manager.createNamedQuery("Redirects.findByUrl", Redirects.class).setParameter("url", url).getSingleResult();
              redURL.setAmountRedir(redURL.getAmountRedir()+1);
              manager.merge(redURL);
            } catch (NoResultException ex) {
                redURL = new Redirects(url, 1);
                manager.persist(redURL);
            }
        
        manager.getTransaction().commit();
     }