Search in sources :

Example 76 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method findAllSubunidadesDidaticas.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public SubunidadeDidaticaDTO[] findAllSubunidadesDidaticas(Long unidadeId) {
    SubunidadeDidaticaDAO dao = factory.getSubunidadeDidaticaDAO();
    SubunidadeDidaticaDTO[] subunidadesArray = null;
    try {
        List<SubunidadeDidatica> subunidades = dao.findAll(unidadeId);
        subunidadesArray = new SubunidadeDidaticaDTO[subunidades.size()];
        for (int i = 0; i < subunidadesArray.length; i++) {
            subunidadesArray[i] = subunidades.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 subunidadesArray;
}
Also used : SubunidadeDidatica(com.tomasio.projects.trainning.model.SubunidadeDidatica) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) SubunidadeDidaticaDTO(com.tomasio.projects.trainning.dto.SubunidadeDidaticaDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 77 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method findAllConceituacoesByPUD.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public ConceituacaoDTO[] findAllConceituacoesByPUD(Long pudId) {
    ConceituacaoDAO dao = factory.getConceituacaoDAO();
    ConceituacaoDTO[] conceituacoesArray = null;
    try {
        List<Conceituacao> conceituacoes = dao.findAll(pudId);
        conceituacoesArray = new ConceituacaoDTO[conceituacoes.size()];
        for (int i = 0; i < conceituacoesArray.length; i++) {
            conceituacoesArray[i] = conceituacoes.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 conceituacoesArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Conceituacao(com.tomasio.projects.trainning.model.Conceituacao) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConceituacaoDTO(com.tomasio.projects.trainning.dto.ConceituacaoDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 78 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method findAllAnexosApostilas.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public AnexoApostilaDTO[] findAllAnexosApostilas(Long apostilaId) {
    AnexoApostilaDAO dao = factory.getAnexoApostilaDAO();
    AnexoApostilaDTO[] anexosArray = null;
    try {
        List<AnexoApostila> anexos = dao.findAllAnexosApostilas(apostilaId);
        anexosArray = new AnexoApostilaDTO[anexos.size()];
        for (int i = 0; i < anexosArray.length; i++) {
            anexosArray[i] = anexos.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 anexosArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) AnexoApostila(com.tomasio.projects.trainning.model.AnexoApostila) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AnexoApostilaDTO(com.tomasio.projects.trainning.dto.AnexoApostilaDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 79 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method findAllDisciplinasByCurriculoMinimo.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public DisciplinaDTO[] findAllDisciplinasByCurriculoMinimo(Long curriculoMinimoId) {
    DisciplinaDAO dao = factory.getDisciplinaDAO();
    DisciplinaDTO[] disciplinasArray = null;
    try {
        List<Disciplina> disciplinas = dao.findAllByCurriculoMinimo(curriculoMinimoId);
        disciplinasArray = new DisciplinaDTO[disciplinas.size()];
        for (int i = 0; i < disciplinasArray.length; i++) {
            disciplinasArray[i] = disciplinas.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 disciplinasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Disciplina(com.tomasio.projects.trainning.model.Disciplina) ObjetivoDisciplina(com.tomasio.projects.trainning.model.ObjetivoDisciplina) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 80 with DAOException

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

the class TrainningServiceSimpleImpl method searchCurso.

@Override
@Transactional(readOnly = true)
public CursoDTO[] searchCurso(String searchTerm, Long planoId, Long areaId, Boolean ativo, Boolean permiteEstrangeiro) {
    CursoDAO dao = factory.getCursoDAO();
    CursoDTO[] cursosArray = null;
    try {
        List<Curso> cursos = dao.search(searchTerm, planoId, areaId, ativo, permiteEstrangeiro);
        if (cursos != null) {
            cursosArray = new CursoDTO[cursos.size()];
            for (int i = 0; i < cursos.size(); i++) {
                cursosArray[i] = cursos.get(i).createDTOWithoutDependencies();
            }
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return cursosArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CursoDTO(com.tomasio.projects.trainning.dto.CursoDTO) Curso(com.tomasio.projects.trainning.model.Curso) CursoDAO(com.tomasio.projects.trainning.dao.CursoDAO) 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