public void destroy(String id) throws IllegalOrphanException, NonexistentEntityException, RollbackFailureException, Exception {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Area area;
            try {
                area = em.getReference(Area.class, id);
                area.getAreidArea();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The area with id " + id + " no longer exists.", enfe);
            }
            List<String> illegalOrphanMessages = null;
            Collection<Depto> deptoCollectionOrphanCheck = area.getDeptoCollection();
            for (Depto deptoCollectionOrphanCheckDepto : deptoCollectionOrphanCheck) {
                if (illegalOrphanMessages == null) {
                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("This Area (" + area + ") cannot be destroyed since the Depto " + deptoCollectionOrphanCheckDepto + " in its deptoCollection field has a non-nullable areaareidArea field.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            Sucursal sucursalSucursalidSucursal = area.getSucursalSucursalidSucursal();
            if (sucursalSucursalidSucursal != null) {
                sucursalSucursalidSucursal.getAreaCollection().remove(area);
                sucursalSucursalidSucursal = em.merge(sucursalSucursalidSucursal);
            }
            em.remove(area);
            em.getTransaction().commit();
        } catch (Exception ex) {
            try {
                em.getTransaction().rollback();
            } catch (Exception re) {
                throw new RollbackFailureException("An error occurred attempting to roll back the transaction.", re);
            }
            throw ex;
        } finally {
            if (em != null) {
                em.close();
            }
        }
    }