public void create(Telecommunications telecommunications) throws PreexistingEntityException, RollbackFailureException, Exception {
        if (telecommunications.getItItemCollection() == null) {
            telecommunications.setItItemCollection(new ArrayList<ItItem>());
        }
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Collection<ItItem> attachedItItemCollection = new ArrayList<ItItem>();
            for (ItItem itItemCollectionItItemToAttach : telecommunications.getItItemCollection()) {
                itItemCollectionItItemToAttach = em.getReference(itItemCollectionItItemToAttach.getClass(), itItemCollectionItItemToAttach.getItSerie());
                attachedItItemCollection.add(itItemCollectionItItemToAttach);
            }
            telecommunications.setItItemCollection(attachedItItemCollection);
            em.persist(telecommunications);
            for (ItItem itItemCollectionItItem : telecommunications.getItItemCollection()) {
                Telecommunications oldTelecommunicationsidTelecomOfItItemCollectionItItem = itItemCollectionItItem.getTelecommunicationsidTelecom();
                itItemCollectionItItem.setTelecommunicationsidTelecom(telecommunications);
                itItemCollectionItItem = em.merge(itItemCollectionItItem);
                if (oldTelecommunicationsidTelecomOfItItemCollectionItItem != null) {
                    oldTelecommunicationsidTelecomOfItItemCollectionItItem.getItItemCollection().remove(itItemCollectionItItem);
                    oldTelecommunicationsidTelecomOfItItemCollectionItItem = em.merge(oldTelecommunicationsidTelecomOfItItemCollectionItItem);
                }
            }
            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);
            }
            if (findTelecommunications(telecommunications.getIdTelecom()) != null) {
                throw new PreexistingEntityException("Telecommunications " + telecommunications + " already exists.", ex);
            }
            throw ex;
        } finally {
            if (em != null) {
                em.close();
            }
        }
    }