public void create(Lenguaje lenguaje) throws PreexistingEntityException, RollbackFailureException, Exception {
        if (lenguaje.getEmpleadoCollection() == null) {
            lenguaje.setEmpleadoCollection(new ArrayList<Empleado>());
        }
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Collection<Empleado> attachedEmpleadoCollection = new ArrayList<Empleado>();
            for (Empleado empleadoCollectionEmpleadoToAttach : lenguaje.getEmpleadoCollection()) {
                empleadoCollectionEmpleadoToAttach = em.getReference(empleadoCollectionEmpleadoToAttach.getClass(), empleadoCollectionEmpleadoToAttach.getEmpNoEmpleado());
                attachedEmpleadoCollection.add(empleadoCollectionEmpleadoToAttach);
            }
            lenguaje.setEmpleadoCollection(attachedEmpleadoCollection);
            em.persist(lenguaje);
            for (Empleado empleadoCollectionEmpleado : lenguaje.getEmpleadoCollection()) {
                empleadoCollectionEmpleado.getLenguajeCollection().add(lenguaje);
                empleadoCollectionEmpleado = em.merge(empleadoCollectionEmpleado);
            }
            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 (findLenguaje(lenguaje.getLenLenguaje()) != null) {
                throw new PreexistingEntityException("Lenguaje " + lenguaje + " already exists.", ex);
            }
            throw ex;
        } finally {
            if (em != null) {
                em.close();
            }
        }
    }