public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            AccessConfigUser accessConfigUser;
            try {
                accessConfigUser = em.getReference(AccessConfigUser.class, id);
                accessConfigUser.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The accessConfigUser with id " + id + " no longer exists.", enfe);
            }
            List<String> illegalOrphanMessages = null;
            List<AccessEspeciales> accessEspecialesListOrphanCheck = accessConfigUser.getAccessEspecialesList();
            for (AccessEspeciales accessEspecialesListOrphanCheckAccessEspeciales : accessEspecialesListOrphanCheck) {
                if (illegalOrphanMessages == null) {
                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("This AccessConfigUser (" + accessConfigUser + ") cannot be destroyed since the AccessEspeciales " + accessEspecialesListOrphanCheckAccessEspeciales + " in its accessEspecialesList field has a non-nullable idConfigUsuario field.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            AccessPerfiles idPerfiles = accessConfigUser.getIdPerfiles();
            if (idPerfiles != null) {
                idPerfiles.getAccessConfigUserList().remove(accessConfigUser);
                idPerfiles = em.merge(idPerfiles);
            }
            em.remove(accessConfigUser);
            em.getTransaction().commit();
        } finally {
            if (em != null) {
                em.close();
            }
        }
    }