Search in sources :

Example 31 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method findAllDominiosAprendizagem.

@Override
@Transactional(readOnly = true)
public DominioAprendizagemDTO[] findAllDominiosAprendizagem() {
    NivelAprendizagemDAO dao = factory.getNivelAprendizagemDAO();
    DominioAprendizagemDTO[] dominiosArray = null;
    try {
        List<DominioAprendizagem> dominios = dao.findAllDominiosAprendizagem();
        if (dominios != null) {
            dominiosArray = new DominioAprendizagemDTO[dominios.size()];
            for (int i = 0; i < dominios.size(); i++) {
                dominiosArray[i] = dominios.get(i).createDTO();
            }
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return dominiosArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DominioAprendizagemDTO(com.tomasio.projects.trainning.dto.DominioAprendizagemDTO) DominioAprendizagem(com.tomasio.projects.trainning.model.DominioAprendizagem) Transactional(org.springframework.transaction.annotation.Transactional)

Example 32 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method createCurriculoMinimo.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createCurriculoMinimo(CurriculoMinimoDTO curriculo) {
    CurriculoMinimoDAO dao = factory.getCurriculoMinimoDAO();
    CurriculoMinimo model = new CurriculoMinimo(curriculo);
    Long id = null;
    try {
        id = dao.create(model);
    } 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) CurriculoMinimo(com.tomasio.projects.trainning.model.CurriculoMinimo) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 33 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method updateDominioAprendizagem.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateDominioAprendizagem(DominioAprendizagemDTO dominioAprendizagem) {
    NivelAprendizagemDAO dao = factory.getNivelAprendizagemDAO();
    DominioAprendizagem _domino = new DominioAprendizagem(dominioAprendizagem);
    try {
        dao.updateDominioAprendizagem(_domino);
    } catch (DAOException ex) {
        throw new CoreException(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) DominioAprendizagem(com.tomasio.projects.trainning.model.DominioAprendizagem) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 34 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method createObjetivoOperacionalizado.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createObjetivoOperacionalizado(ObjetivoOperacionalizadoDTO objetivo) {
    ObjetivoOperacionalizadoDAO dao = factory.getObjetivoOperacionalizadoDAO();
    ObjetivoOperacionalizado model = new ObjetivoOperacionalizado(objetivo);
    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 : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ObjetivoOperacionalizado(com.tomasio.projects.trainning.model.ObjetivoOperacionalizado) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 35 with DAOException

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

the class TeachingDocumentsServiceSimpleImpl method createObjetivoUnidadeDidatica.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createObjetivoUnidadeDidatica(ObjetivoUnidadeDidaticaDTO objetivo) {
    ObjetivoUnidadeDidaticaDAO dao = factory.getObjetivoUnidadeDidaticaDAO();
    ObjetivoUnidadeDidatica model = new ObjetivoUnidadeDidatica(objetivo);
    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 : DAOException(com.tomasio.projects.trainning.exception.DAOException) ObjetivoUnidadeDidatica(com.tomasio.projects.trainning.model.ObjetivoUnidadeDidatica) 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)

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