Search in sources :

Example 26 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method createPerfilRelacionamento.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createPerfilRelacionamento(PerfilRelacionamentoDTO perfil) {
    PerfilRelacionamentoDAO dao = factory.getPerfilRelacionamentoDAO();
    PerfilRelacionamento model = new PerfilRelacionamento(perfil);
    Long id = null;
    try {
        id = dao.create(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
    return id;
}
Also used : PerfilRelacionamento(com.tomasio.projects.trainning.model.PerfilRelacionamento) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 27 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method createSubunidadeDidatica.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createSubunidadeDidatica(SubunidadeDidaticaDTO subunidade) {
    SubunidadeDidaticaDAO dao = factory.getSubunidadeDidaticaDAO();
    SubunidadeDidatica model = new SubunidadeDidatica(subunidade);
    Long id = null;
    try {
        id = dao.create(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
    return id;
}
Also used : SubunidadeDidatica(com.tomasio.projects.trainning.model.SubunidadeDidatica) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 28 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findAllObjetivosDisciplinas.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public ObjetivoDisciplinaDTO[] findAllObjetivosDisciplinas(Long disciplinaId) {
    ObjetivoDisciplinaDAO dao = factory.getObjetivoDisciplinaDAO();
    ObjetivoDisciplinaDTO[] objetivosDisciplinasArray = null;
    try {
        List<ObjetivoDisciplina> objetivos = dao.findAll(disciplinaId);
        objetivosDisciplinasArray = new ObjetivoDisciplinaDTO[objetivos.size()];
        for (int i = 0; i < objetivosDisciplinasArray.length; i++) {
            objetivosDisciplinasArray[i] = objetivos.get(i).createDTO();
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.toString());
    }
    return objetivosDisciplinasArray;
}
Also used : ObjetivoDisciplina(com.tomasio.projects.trainning.model.ObjetivoDisciplina) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 29 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method createGrupoAreaConhecimento.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public Long createGrupoAreaConhecimento(GrupoAreaConhecimentoDTO grupoAreaConhecimento) {
    AreaConhecimentoDAO dao = factory.getAreaConhecimentoDAO();
    GrupoAreaConhecimento _grupo = new GrupoAreaConhecimento(grupoAreaConhecimento);
    Long id = null;
    try {
        id = dao.createGrupoAreaConhecimento(_grupo);
    } catch (DAOException ex) {
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
    return id;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) GrupoAreaConhecimento(com.tomasio.projects.trainning.model.GrupoAreaConhecimento) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 30 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method updateCapituloApostila.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public void updateCapituloApostila(CapituloApostilaDTO capitulo) {
    CapituloApostilaDAO dao = factory.getCapituloApostilaDAO();
    CapituloApostila model = new CapituloApostila(capitulo);
    try {
        dao.update(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CapituloApostila(com.tomasio.projects.trainning.model.CapituloApostila) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)643 CoreException (com.tomasio.projects.trainning.exeption.CoreException)388 Transactional (org.springframework.transaction.annotation.Transactional)385 HibernateException (org.hibernate.HibernateException)186 Session (org.hibernate.Session)186 ParseException (java.text.ParseException)112 Organizacao (com.tomasio.projects.trainning.model.Organizacao)77 ArrayList (java.util.ArrayList)57 Criteria (org.hibernate.Criteria)51 Pessoa (com.tomasio.projects.trainning.model.Pessoa)46 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)37 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)37 TurmaEfetiva (com.tomasio.projects.trainning.model.TurmaEfetiva)33 PreMatriculaDAO (com.tomasio.projects.trainning.dao.PreMatriculaDAO)32 PreMatricula (com.tomasio.projects.trainning.model.PreMatricula)30 StatusTurmaEfetiva (com.tomasio.projects.trainning.model.StatusTurmaEfetiva)30 Matricula (com.tomasio.projects.trainning.model.Matricula)29 SimpleDateFormat (java.text.SimpleDateFormat)28 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)26 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)26