Search in sources :

Example 6 with PerfilRelacionamento

use of com.tomasio.projects.trainning.model.PerfilRelacionamento in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findAllPerfisRelacionamentoByDisciplina.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public PerfilRelacionamentoDTO[] findAllPerfisRelacionamentoByDisciplina(Long disciplinaId) {
    PerfilRelacionamentoDAO dao = factory.getPerfilRelacionamentoDAO();
    PerfilRelacionamentoDTO[] perfilsArray = null;
    try {
        List<PerfilRelacionamento> perfils = dao.findAll(disciplinaId);
        perfilsArray = new PerfilRelacionamentoDTO[perfils.size()];
        for (int i = 0; i < perfilsArray.length; i++) {
            perfilsArray[i] = perfils.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 perfilsArray;
}
Also used : PerfilRelacionamento(com.tomasio.projects.trainning.model.PerfilRelacionamento) DAOException(com.tomasio.projects.trainning.exception.DAOException) PerfilRelacionamentoDTO(com.tomasio.projects.trainning.dto.PerfilRelacionamentoDTO) 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)6 PerfilRelacionamento (com.tomasio.projects.trainning.model.PerfilRelacionamento)6 CoreException (com.tomasio.projects.trainning.exeption.CoreException)4 Transactional (org.springframework.transaction.annotation.Transactional)4 HibernateException (org.hibernate.HibernateException)2 Session (org.hibernate.Session)2 PerfilRelacionamentoDTO (com.tomasio.projects.trainning.dto.PerfilRelacionamentoDTO)1 Criteria (org.hibernate.Criteria)1