Search in sources :

Example 66 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException 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 67 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException 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)

Example 68 with DAOException

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

the class OrganizationalServiceSimpleImpl method searchOrganizacoesByNome.

@Override
@Transactional(readOnly = true)
public OrganizacaoDTO[] searchOrganizacoesByNome(String term) {
    OrganizacaoDAO dao = factory.getOrganizacaoDAO();
    OrganizacaoDTO[] organizacoesArray = null;
    try {
        List<Organizacao> organizacoes = dao.searchByNome(term);
        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 69 with DAOException

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

the class OrganizationalServiceSimpleImpl method createPosto.

@Override
@Transactional
public Long createPosto(PostoDTO posto) {
    PostoDAO dao = factory.getPostoDAO();
    Posto model = new Posto(posto);
    Long id = null;
    try {
        id = dao.create(model);
    } 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) Posto(com.tomasio.projects.trainning.model.Posto) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 70 with DAOException

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

the class OrganizationalServiceSimpleImpl method findAllComandosByCidadeId.

@Override
@Transactional(readOnly = true)
public OrganizacaoDTO[] findAllComandosByCidadeId(Long cidadeId) {
    OrganizacaoDAO dao = factory.getOrganizacaoDAO();
    OrganizacaoDTO[] organizacoesArray = null;
    try {
        List<Organizacao> organizacoes = dao.findAllComandoByCidadeId(cidadeId);
        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

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