public void deleteService(String id) {
        long tempid = Long.parseLong(id);
        Query q = em.createQuery("SELECT t from ServiceEntity t");
        for (Object o : q.getResultList()) {
            ServiceEntity p = (ServiceEntity) o;
            if (p.getId() == tempid) {

                p.setRooms(null);
                em.merge(p);
                em.flush();

                em.remove(p);
                em.flush();
                break;
            }
        }
    }