Package ecar.exception

Examples of ecar.exception.ECARException


              //quando n�o � encontrado nenhum registro gera exce��o
              itemEstFRAux = null;
            }
           
            if (itemEstFRAux != null) {
              throw new ECARException("itemEstrutura.fonteRecurso.inclusao.jaExiste");
            }
           
            session.save(itemEstruturaFonteRecurso);
            objetos.add(itemEstruturaFonteRecurso);
           
            ItemEstruturaPrevisaoRevDao itemEstPrevisaoDao = new ItemEstruturaPrevisaoRevDao(request);
           
            Iterator itRecursos = listaRecursos.iterator();
            while (itRecursos.hasNext()) {
              EfIettPrevisaoRevEfiepr recurso = (EfIettPrevisaoRevEfiepr) itRecursos.next();
              itemEstPrevisaoDao.setPK(recurso);
              session.save(recurso);
                objetos.add(recurso);
            }
           
            tx.commit();
           
            if(super.logBean != null) {
        super.logBean.setCodigoTransacao(Data.getHoraAtual(false));
        super.logBean.setOperacao("INC");
        Iterator itObj = objetos.iterator();

        while(itObj.hasNext()) {
          super.logBean.setObj(itObj.next());
          super.loggerAuditoria.info(logBean.toString());
        }
      }
        } catch (HibernateException he) {
      if (tx != null)
        try {
          tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(he);
      throw new ECARException("erro.hibernateException");
    }
    }
View Full Code Here


      if (tx != null)
        try {
          tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(he);
      throw new ECARException("erro.hibernateException");
    }
    }
View Full Code Here

      if (tx != null)
        try {
          tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(e);
      throw new ECARException("erro.hibernateException");
    }
    }
View Full Code Here

      if (tx != null)
        try {
        //  tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(e);
      throw new ECARException("erro.hibernateException");
    } catch (ECARException e) {
      if (tx != null)
        try {
          //tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(e);
      throw e;
    }
  }
View Full Code Here

      if (tx != null)
        try {
          tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(e);
      throw new ECARException("erro.hibernateException");
    } catch (ECARException e) {
      if (tx != null)
        try {
          tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(e);
      throw e;
    }
  }
View Full Code Here

      if (tx != null)
        try {
          tx.rollback();
        } catch (HibernateException r) {
          this.logger.error(r);
          throw new ECARException("erro.hibernateException");
        }
      this.logger.error(e);
      throw new ECARException("erro.hibernateException");
    }
  }
View Full Code Here

            if (contar(tipoAcomp.getAcompReferenciaArefs()) > 0) {
                excluir = false;

                AcompReferenciaAref ocorrencia =
                        (AcompReferenciaAref) new ArrayList(tipoAcomp.getAcompReferenciaArefs()).get(0);
                throw new ECARException("tipoAcompanhamento.exclusao.erro.existeAref", null,
                        new String[]{ocorrencia.getNomeAref()});
            }

            if (contar(tipoAcomp.getEstAtribTipoAcompEatas()) > 0) {
                excluir = false;

                EstAtribTipoAcompEata estAtribTipoAcompEata =
                        (EstAtribTipoAcompEata) new ArrayList(tipoAcomp.getEstAtribTipoAcompEatas()).get(0);
                throw new ECARException("tipoAcompanhamento.exclusao.erro.existeEata", null, new String[]{});
            }

            if (excluir) {
                ArrayList objetos = new ArrayList();
                super.inicializarLogBean();

                tx = session.beginTransaction();

                for (Iterator itEXC = tipoAcomp.getTipoAcompFuncAcompTafcs().iterator(); itEXC.hasNext();) {
                    TipoAcompFuncAcompTafc tafc = (TipoAcompFuncAcompTafc) itEXC.next();
                    session.delete(tafc);
                    objetos.add(tafc);
                }

                // Deleta as ocorrencias de Estrutura Atributo Tipo Acompanhamento relacionadas ao TipoAcompanhamento.
//          for (Iterator itEXC = tipoAcomp.getEstAtribTipoAcompEatas().iterator(); itEXC.hasNext();) {
//                EstAtribTipoAcompEata eata = (EstAtribTipoAcompEata) itEXC.next();
//                session.delete(eata);
//                  objetos.add(eata);
//              }
                session.delete(tipoAcomp);
                objetos.add(tipoAcomp);

                tx.commit();

                if (super.logBean != null) {
                    super.logBean.setCodigoTransacao(Data.getHoraAtual(false));
                    super.logBean.setOperacao("EXC");

                    for (Iterator itObj = objetos.iterator(); itObj.hasNext();) {
                        super.logBean.setObj(itObj.next());
                        super.loggerAuditoria.info(logBean.toString());
                    }
                }
            }
        } catch (HibernateException he) {
            if (tx != null) {
                try {
                    tx.rollback();
                } catch (HibernateException r) {
                    this.logger.error(r);
                    throw new ECARException("erro.hibernateException");
                }
            }

            this.logger.error(he);
            throw new ECARException("erro.hibernateException");
        }
    }
View Full Code Here

            if (tx != null) {
                try {
                    tx.rollback();
                } catch (HibernateException r) {
                    this.logger.error(r);
                    throw new ECARException("erro.hibernateException");
                }
            }

            this.logger.error(he);
            throw new ECARException("erro.hibernateException");
        }
    }
View Full Code Here

            if (tx != null) {
                try {
                    tx.rollback();
                } catch (HibernateException r) {
                    this.logger.error(r);
                    throw new ECARException("erro.hibernateException");
                }
            }

            this.logger.error(he);
            throw new ECARException("erro.hibernateException");
        }
    }
View Full Code Here

            return this.getSession().createQuery("select distinct ta from TipoAcompanhamentoTa ta " +
                    "join ta.acompReferenciaArefs " + "where ta.indAtivoTa = :ativo " +
                    "order by ta.seqApresentacaoTa").setString("ativo", Dominios.ATIVO).list();
        } catch (HibernateException e) {
            this.logger.error(e);
            throw new ECARException(e);
        }
    }
View Full Code Here

TOP

Related Classes of ecar.exception.ECARException

Copyright © 2018 www.massapicom. 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.