Search in sources :

Example 1 with StatusTurmaEfetiva

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

the class AtividadesEnsinoServiceSimpleImpl method findAllTurmasEfetivas.

@Override
@Transactional(readOnly = true)
public TurmaEfetivaDTO[] findAllTurmasEfetivas(Date exercicio, Long planoId, Long cursoId, Long responsavelId, Long organizacaoGestoraId, StatusTurmaEfetiva status) {
    TurmaDAO dao = factory.getTurmaDAO();
    TurmaEfetivaDTO[] turmasArray = null;
    try {
        List<TurmaEfetiva> turmas = dao.findAllTurmasEfetivas(exercicio, planoId, cursoId, responsavelId, organizacaoGestoraId, status);
        // }
        if (turmas != null) {
            turmasArray = new TurmaEfetivaDTO[turmas.size()];
            for (int i = 0; i < turmas.size(); i++) {
                turmasArray[i] = turmas.get(i).createDTOWithoutDependencies();
            }
        }
    } catch (DAOException ex) {
        ex.printStackTrace();
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
    return turmasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) TurmaEfetivaDTO(com.tomasio.projects.trainning.dto.TurmaEfetivaDTO) StatusTurmaEfetiva(com.tomasio.projects.trainning.model.StatusTurmaEfetiva) TurmaEfetiva(com.tomasio.projects.trainning.model.TurmaEfetiva) CoreException(com.tomasio.projects.trainning.exeption.CoreException) TurmaDAO(com.tomasio.projects.trainning.dao.TurmaDAO) DAOException(com.tomasio.projects.trainning.exception.DAOException) ParseException(java.text.ParseException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with StatusTurmaEfetiva

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

the class PlanningServiceSimpleImpl method findAllTurmasEfetivas.

@Override
@Transactional(readOnly = true)
public TurmaEfetivaDTO[] findAllTurmasEfetivas(Date exercicio, Long planoId, Long cursoId, Long responsavelId, Long organizacaoGestoraId, StatusTurmaEfetiva status) {
    TurmaDAO dao = factory.getTurmaDAO();
    TurmaEfetivaDTO[] turmasArray = null;
    try {
        List<TurmaEfetiva> turmas = dao.findAllTurmasEfetivas(exercicio, planoId, cursoId, responsavelId, organizacaoGestoraId, status);
        if (turmas != null) {
            turmasArray = new TurmaEfetivaDTO[turmas.size()];
            for (int i = 0; i < turmas.size(); i++) {
                turmasArray[i] = turmas.get(i).createDTOWithoutDependencies();
            }
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return turmasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) StatusTurmaEfetiva(com.tomasio.projects.trainning.model.StatusTurmaEfetiva) TurmaEfetiva(com.tomasio.projects.trainning.model.TurmaEfetiva) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)2 CoreException (com.tomasio.projects.trainning.exeption.CoreException)2 StatusTurmaEfetiva (com.tomasio.projects.trainning.model.StatusTurmaEfetiva)2 TurmaEfetiva (com.tomasio.projects.trainning.model.TurmaEfetiva)2 Transactional (org.springframework.transaction.annotation.Transactional)2 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)1 TurmaEfetivaDTO (com.tomasio.projects.trainning.dto.TurmaEfetivaDTO)1 ParseException (java.text.ParseException)1