Search in sources :

Example 46 with Organizacao

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

the class OrganizationalServiceSimpleImpl method findOrganizacaoBySigla.

@Override
@Transactional(readOnly = true)
public OrganizacaoDTO findOrganizacaoBySigla(String sigla) {
    OrganizacaoDAO dao = factory.getOrganizacaoDAO();
    Organizacao organizacao = null;
    try {
        organizacao = dao.findBySigla(sigla);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    if (organizacao != null) {
        return organizacao.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Organizacao(com.tomasio.projects.trainning.model.Organizacao) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 47 with Organizacao

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

the class OrganizationalServiceSimpleImpl method searchComandosByNome.

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

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

the class OrganizationalServiceSimpleImpl method findAllOrganizacoesFABByCidadeId.

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

Example 49 with Organizacao

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

the class OrganizationalServiceSimpleImpl method findAllOrganizacoesExternas.

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

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

the class OrganizationalServiceSimpleImpl method findAllComandos.

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

Organizacao (com.tomasio.projects.trainning.model.Organizacao)80 DAOException (com.tomasio.projects.trainning.exception.DAOException)77 Transactional (org.springframework.transaction.annotation.Transactional)45 CoreException (com.tomasio.projects.trainning.exeption.CoreException)41 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)35 OrganizacaoDAO (com.tomasio.projects.trainning.dao.OrganizacaoDAO)19 Pessoa (com.tomasio.projects.trainning.model.Pessoa)19 PessoaDAO (com.tomasio.projects.trainning.dao.PessoaDAO)17 HibernatePessoaDAO (com.tomasio.projects.trainning.dao.HibernatePessoaDAO)15 ImportTurmasImplEfetivasFromTabelao (com.tomasio.projects.trainning.migration.ImportTurmasImplEfetivasFromTabelao)10 ResultSet (java.sql.ResultSet)10 SQLException (java.sql.SQLException)10 Statement (java.sql.Statement)10 HibernateOrganizacaoDAO (com.tomasio.projects.trainning.dao.HibernateOrganizacaoDAO)9 ArrayList (java.util.ArrayList)9 Date (java.sql.Date)8 NetworkUserDAO (com.tomasio.projects.trainning.dao.NetworkUserDAO)5 Session (org.hibernate.Session)5 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)4 NetworkGroupDAO (com.tomasio.projects.trainning.dao.NetworkGroupDAO)4