Package br.com.procempa.modus.session

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


  public static Visita terminate(String 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


        try {
          equipamento.setUser(UserContext.getInstance().getUsuario());
        } catch (RuntimeException e) {
          equipamento.setUser(null);
        }
        equipamento = (Equipamento) pa.persist(equipamento);
      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException e) {
      e.printStackTrace();
View Full Code Here

      ValidationList validationList = validate(telecentro);
     
      if (validationList.isValid()) {
        telecentro.setUser(UserContext.getInstance().getUsuario());
        telecentro = (Telecentro) pa.persist(telecentro);
      } else {
        throw new ValidationException(validationList);
      }
     
    } catch (NamingException e) {
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

    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();

      encontro.setUser(UserContext.getInstance().getUsuario());
      if (encontro.getId() == null){
        encontro = (Encontro) pa.persist(encontro);
        List<Inscricao> inscritos = InscricaoDataServices.getList(encontro.getTurma());
        for (Inscricao inscrito : inscritos) {
          Presenca presenca = new Presenca();
          presenca.setInscricao(inscrito);
          presenca.setEncontro(encontro);
View Full Code Here

          presenca.setEncontro(encontro);
          PresencaDataServices.persist(presenca);
        }
      }
      else{
        encontro = (Encontro) pa.persist(encontro);
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
View Full Code Here

      pa = PersistentAccessFactory.getInstance();
      ValidationList validationList = validate(visita);

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

      pa = PersistentAccessFactory.getInstance();
      ValidationList validationList = validate(visita);

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

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

      presenca = (Presenca) pa.persist(presenca);

    } catch (Exception e) {
      e.printStackTrace();
      //throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
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.