Package br.com.procempa.modus.session

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


      List<String> messages) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();

      if (isValid(equipamento, messages)) {
        equipamento = (Equipamento) pa.persist(equipamento);

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


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

            if (isValid(equipamento, messages)) {
                pa.persist(equipamento);

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

      PersistentAccess pa = PersistentAccessFactory.getInstance();

      boolean isInsert = usuario.getId() == null || usuario.getId() < 1;

      if (isValid(usuario, messages)) {
        pa.persist(usuario);

        if (isInsert) {
          String[] emails = null;
          if (StringUtils.isEmpty(usuario.getEmail())) {
            emails = new String[] { "petrillo@procempa.com.br" };
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

      throws UsuarioException {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();

      if (isValid(usuario, messages)) {
        usuario = (Usuario) pa.persist(usuario);
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new UsuarioException(e.getClass().getName() + ": "
          + e.getMessage());
View Full Code Here

    if (!users.isEmpty()) {
      Usuario u = (Usuario) users.get(0);
      if (u.getVisitaList().isEmpty()) {
        u.setStatus(Status.EXCLUIDO);
        pa.persist(u);
      } else {
        throw new BusinessException(
            "Desculpe, mas n�o � poss�vel remover um usu�rio com visitas registradas.");
      }
    }
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

  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Presenca presenca = (Presenca) pa.find(Presenca.class, id);
      presenca.setStatus(Status.EXCLUIDO);
      pa.persist(presenca);
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
  }
View Full Code Here

        for (Turma turma : turmas) {
          TurmaDataServices.remove(turma.getId());
        }

        curso.setStatus(Status.EXCLUIDO);
        pa.persist(curso);
      }
      else{
        JOptionPane.showMessageDialog(null, "N�o � poss�vel excluir! \nO curso possui usu�rios inscritos.", "Aten��o!", JOptionPane.WARNING_MESSAGE);
      }
    } catch (Exception e) {
View Full Code Here

      throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();

      if (isValid(curso, messages)) {
        curso = (Curso) pa.persist(curso);

      }
    } 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.