Package br.com.procempa.modus.session

Examples of br.com.procempa.modus.session.PersistentAccess.persist()


      PersistentAccess pa = PersistentAccessFactory.getInstance();
      ValidationList validationList = validate(usuario);

      if (validationList.isValid()) {
        usuario.setUser(UserContext.getInstance().getUsuario());
        usuario = (Usuario) pa.persist(usuario);
      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException ne) {
      ne.printStackTrace();
View Full Code Here


      PersistentAccess pa = PersistentAccessFactory.getInstance();
      ValidationList validationList = validate(usuario);

      if (validationList.isValid()) {
        usuario.setUser(UserContext.getInstance().getUsuario());
        usuario = (Usuario) pa.persist(usuario);
      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException ne) {
      ne.printStackTrace();
View Full Code Here

      ValidationList validationList = validate(curso);

      if (validationList.isValid()) {
        curso.setUser(UserContext.getInstance().getUsuario());
        curso = (Curso) pa.persist(curso);
      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException e) {
      e.printStackTrace();
View Full Code Here

  public static FilaInscricao persist(FilaInscricao listaEspera) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      listaEspera.setUser(UserContext.getInstance().getUsuario());
      listaEspera = (FilaInscricao) pa.persist(listaEspera);

    } catch (Exception e) {
      e.printStackTrace();
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
View Full Code Here

      ValidationList validationList = validate(turma);

      turma.setUser(UserContext.getInstance().getUsuario());
      if (validationList.isValid()) {
        if (turma.getId() == null) {
          turma = (Turma) pa.persist(turma);
          List<Conteudo> conteudos = ConteudoDataServices
              .getList(turma.getCurso());
          for (Conteudo conteudo : conteudos) {
            Encontro encontro = new Encontro();
            encontro.setTurma(turma);
View Full Code Here

          for (Conteudo conteudo : conteudos) {
            Encontro encontro = new Encontro();
            encontro.setTurma(turma);
            encontro.setConteudo(conteudo);
            encontro.setData("");
            encontro = (Encontro) pa.persist(encontro);
          }
        } else {
          turma = (Turma) pa.persist(turma);
        }
      } else {
View Full Code Here

            encontro.setConteudo(conteudo);
            encontro.setData("");
            encontro = (Encontro) pa.persist(encontro);
          }
        } else {
          turma = (Turma) pa.persist(turma);
        }
      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException e) {
View Full Code Here

    PersistentAccess pa;
    try {
      pa = PersistentAccessFactory.getInstance();
      log = (ExceptionLog) pa.find(ExceptionLog.class, log.getId());
      log.setUserDescription(userDesc);
      log = (ExceptionLog) pa.persist(log);
    } catch (NamingException e) {
      e.printStackTrace();
    }
    return log;
  }
View Full Code Here

  public static Visita persist(Visita visita, List<String> messages)
      throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();

    if (isValid(visita, messages)) {
      visita = (Visita) pa.persist(visita);
    }
    return visita;
  }

  private static boolean isValid(Visita visita, List<String> messages)
View Full Code Here

  public static Visita terminate(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    v.setDataFim(new Date());
    v = (Visita) pa.persist(v);
    if (!v.isListaEspera()) {
      Equipamento eq = v.getEquipamento();
      EquipamentoDataServices.closeStation(eq);
    }
    return v;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.