public String guardarTelefono(GthTelefono telefono) {
    EntityManager manejador = fabrica.createEntityManager();
    try {
      utx.begin();
      if (telefono.getIdeGttel() == null) {
        // asignar maximo

        long ideaspvh =
            new Long(utilitario.getConexion().getMaximo("GTH_TELEFONO", "IDE_GTTEL", 1));
        System.out.println("guardar telefono " + ideaspvh);
        Integer conertideaspvh = 1; // (int) ideaspvh;
        telefono.setIdeGttel(conertideaspvh); // maximo de utilitario
        System.out.println("telefono " + telefono);
        manejador.persist(telefono);
      } else {
        manejador.merge(telefono);
      }
      utx.commit();
    } catch (Exception e) {
      try {
        utx.rollback();
      } catch (Exception e1) {
      }
      return e.getMessage();
    } finally {
      manejador.close();
    }
    return "";
  }
 public String guardarConyugue(GthConyuge conyugue, GthTelefono telefono) {
   EntityManager manejador = fabrica.createEntityManager();
   try {
     utx.begin();
     manejador.joinTransaction();
     // Guarda o modifica
     if (conyugue.getIdeGtcon() == null) {
       long idegtcon = new Long(utilitario.getConexion().getMaximo("GTH_CONYUGE", "IDE_GTCON", 1));
       Integer conertideaspvh = (int) idegtcon;
       conyugue.setIdeGtcon(conertideaspvh);
       manejador.persist(conyugue);
       telefono.setIdeGtcon(conyugue);
       long idegttel =
           new Long(utilitario.getConexion().getMaximo("GTH_TELEFONO", "IDE_GTTEL", 1));
       Integer conertideidegttel = (int) idegttel;
       telefono.setIdeGttel(conertideidegttel);
       manejador.persist(telefono);
     } else {
       manejador.merge(conyugue);
       // Si el telefono es nuevo
       if (telefono.getIdeGttel() == null) {
         telefono.setIdeGtcon(conyugue);
         long idegttel =
             new Long(utilitario.getConexion().getMaximo("GTH_TELEFONO", "IDE_GTTEL", 1));
         Integer conertideidegttel = (int) idegttel;
         telefono.setIdeGttel(conertideidegttel);
         manejador.persist(telefono);
       } else {
         manejador.merge(telefono);
       }
     }
     utx.commit();
   } catch (Exception e) {
     try {
       utx.rollback();
     } catch (Exception e1) {
     }
     return e.getMessage();
   } finally {
     manejador.close();
   }
   return "";
 }