Search in sources :

Example 81 with CoreException

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

the class OrganizationalServiceSimpleImpl method updatePosto.

@Override
@Transactional
public void updatePosto(PostoDTO posto) {
    PostoDAO dao = factory.getPostoDAO();
    Posto model = new Posto(posto);
    try {
        dao.update(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Posto(com.tomasio.projects.trainning.model.Posto) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 82 with CoreException

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

the class OrganizationalServiceSimpleImpl method createEstado.

@Override
@Transactional
public Long createEstado(EstadoDTO estado) {
    EstadoDAO dao = factory.getEstadoDAO();
    Long id = null;
    try {
        id = dao.create(new Estado(estado));
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return id;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Estado(com.tomasio.projects.trainning.model.Estado) Transactional(org.springframework.transaction.annotation.Transactional)

Example 83 with CoreException

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

the class OrganizationalServiceSimpleImpl method searchCidades.

@Override
@Transactional(readOnly = true)
public CidadeDTO[] searchCidades(String term) {
    CidadeDAO dao = factory.getCidadeDAO();
    CidadeDTO[] cidadesArray = null;
    try {
        List<Cidade> cidades = dao.search(term);
        if (cidades != null) {
            cidadesArray = convertToArrayCidades(cidades);
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return cidadesArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CidadeDTO(com.tomasio.projects.trainning.dto.CidadeDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Cidade(com.tomasio.projects.trainning.model.Cidade) Transactional(org.springframework.transaction.annotation.Transactional)

Example 84 with CoreException

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

the class OrganizationalServiceSimpleImpl method findAllUnidades.

@Override
@Transactional(readOnly = true)
public OrganizacaoDTO[] findAllUnidades() {
    OrganizacaoDAO dao = factory.getOrganizacaoDAO();
    OrganizacaoDTO[] organizacoesArray = null;
    try {
        List<Organizacao> organizacoes = dao.findAllUnidade();
        if (organizacoes != null) {
            organizacoesArray = convertToArray(organizacoes);
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return organizacoesArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Organizacao(com.tomasio.projects.trainning.model.Organizacao) CoreException(com.tomasio.projects.trainning.exeption.CoreException) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 85 with CoreException

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

the class OrganizationalServiceSimpleImpl method findAllComandosByEstadoId.

@Override
@Transactional(readOnly = true)
public OrganizacaoDTO[] findAllComandosByEstadoId(Long estadoId) {
    OrganizacaoDAO dao = factory.getOrganizacaoDAO();
    OrganizacaoDTO[] organizacoesArray = null;
    try {
        List<Organizacao> organizacoes = dao.findAllComandoByEstadoId(estadoId);
        if (organizacoes != null) {
            organizacoesArray = convertToArray(organizacoes);
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return organizacoesArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Organizacao(com.tomasio.projects.trainning.model.Organizacao) CoreException(com.tomasio.projects.trainning.exeption.CoreException) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) 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