Search in sources :

Example 21 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class SystemServiceSimpleImpl method findAllLogByObjectId.

@Override
@Transactional(readOnly = true)
public LogDTO[] findAllLogByObjectId(String objectId) {
    LogDAO dao = factory.getLogDAO();
    LogDTO[] logsArray = null;
    try {
        List<LogDTO> logs = dao.findAllByObjectId(objectId);
        if (logs != null) {
            logsArray = new LogDTO[logs.size()];
            logs.toArray(logsArray);
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return logsArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) LogDAO(com.tomasio.projects.trainning.dao.LogDAO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) LogDTO(com.tomasio.projects.trainning.dto.LogDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 22 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findAbreviatura.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public AbreviaturaDTO findAbreviatura(Long id) {
    AbreviaturaDAO dao = factory.getAbreviaturaDAO();
    Abreviatura abreviatura = null;
    try {
        abreviatura = dao.find(id);
    } 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());
    }
    if (abreviatura != null) {
        return abreviatura.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Abreviatura(com.tomasio.projects.trainning.model.Abreviatura) 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 23 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method updatePerfilRelacionamento.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updatePerfilRelacionamento(PerfilRelacionamentoDTO perfil) {
    PerfilRelacionamentoDAO dao = factory.getPerfilRelacionamentoDAO();
    PerfilRelacionamento model = new PerfilRelacionamento(perfil);
    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 : 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 24 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method createAtividadeAdministrativa.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createAtividadeAdministrativa(AtividadeAdministrativaDTO atividade) {
    AtividadeAdministrativaDAO dao = factory.getAtividadeAdministrativaDAO();
    AtividadeAdministrativa model = new AtividadeAdministrativa(atividade);
    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) AtividadeAdministrativa(com.tomasio.projects.trainning.model.AtividadeAdministrativa) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 25 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findAllApostilas.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public ApostilaDTO[] findAllApostilas(Long curriculoMinimoId) {
    ApostilaDAO dao = factory.getApostilaDAO();
    ApostilaDTO[] apostilasArray = null;
    try {
        List<Apostila> apostilas = dao.findAllApostilas(curriculoMinimoId);
        apostilasArray = new ApostilaDTO[apostilas.size()];
        for (int i = 0; i < apostilasArray.length; i++) {
            apostilasArray[i] = apostilas.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 apostilasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AnexoApostilaDTO(com.tomasio.projects.trainning.dto.AnexoApostilaDTO) SecaoApostilaDTO(com.tomasio.projects.trainning.dto.SecaoApostilaDTO) ApostilaDTO(com.tomasio.projects.trainning.dto.ApostilaDTO) CapituloApostilaDTO(com.tomasio.projects.trainning.dto.CapituloApostilaDTO) AnexoApostila(com.tomasio.projects.trainning.model.AnexoApostila) Apostila(com.tomasio.projects.trainning.model.Apostila) CapituloApostila(com.tomasio.projects.trainning.model.CapituloApostila) SecaoApostila(com.tomasio.projects.trainning.model.SecaoApostila) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

CoreException (com.tomasio.projects.trainning.exeption.CoreException)435 DAOException (com.tomasio.projects.trainning.exception.DAOException)388 Transactional (org.springframework.transaction.annotation.Transactional)372 ParseException (java.text.ParseException)91 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)53 Organizacao (com.tomasio.projects.trainning.model.Organizacao)41 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)40 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)30 PreMatriculaDAO (com.tomasio.projects.trainning.dao.PreMatriculaDAO)27 IndicacaoAlunoDTO (com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO)25 PreMatricula (com.tomasio.projects.trainning.model.PreMatricula)25 PessoaDTO (com.tomasio.projects.trainning.dto.PessoaDTO)23 PreMatriculaDTO (com.tomasio.projects.trainning.dto.PreMatriculaDTO)21 CancelamentoMatriculaDAO (com.tomasio.projects.trainning.dao.CancelamentoMatriculaDAO)20 NotificacaoMatriculaDAO (com.tomasio.projects.trainning.dao.NotificacaoMatriculaDAO)20 Date (java.util.Date)20 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)19 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)19 CancelamentoMatricula (com.tomasio.projects.trainning.model.CancelamentoMatricula)18 Indicacao (com.tomasio.projects.trainning.model.Indicacao)18