public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            PypAdmControlProfesionales pypAdmControlProfesionales;
            try {
                pypAdmControlProfesionales = em.getReference(PypAdmControlProfesionales.class, id);
                pypAdmControlProfesionales.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The pypAdmControlProfesionales with id " + id + " no longer exists.", enfe);
            }
            List<String> illegalOrphanMessages = null;
            List<PypAdmAsistCon> pypAdmAsistConListOrphanCheck = pypAdmControlProfesionales.getPypAdmAsistConList();
            for (PypAdmAsistCon pypAdmAsistConListOrphanCheckPypAdmAsistCon : pypAdmAsistConListOrphanCheck) {
                if (illegalOrphanMessages == null) {
                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("This PypAdmControlProfesionales (" + pypAdmControlProfesionales + ") cannot be destroyed since the PypAdmAsistCon " + pypAdmAsistConListOrphanCheckPypAdmAsistCon + " in its pypAdmAsistConList field has a non-nullable idControlPro field.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            CmProfesionales idProfesional = pypAdmControlProfesionales.getIdProfesional();
            if (idProfesional != null) {
                idProfesional.getPypAdmControlProfesionalesList().remove(pypAdmControlProfesionales);
                idProfesional = em.merge(idProfesional);
            }
            em.remove(pypAdmControlProfesionales);
            em.getTransaction().commit();
        } finally {
            if (em != null) {
                em.close();
            }
        }
    }