Search in sources :

Example 6 with AnotacaoDAO

use of com.tomasio.projects.trainning.dao.AnotacaoDAO in project trainning by fernandotomasio.

the class SystemServiceSimpleImpl method findAnotacao.

@Override
@Transactional(readOnly = true)
public AnotacaoDTO findAnotacao(Long id) {
    AnotacaoDAO dao = factory.getAnotacaoDAO();
    AnotacaoDTO anotacao = null;
    try {
        anotacao = dao.find(id);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return anotacao;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AnotacaoDTO(com.tomasio.projects.trainning.dto.AnotacaoDTO) AnotacaoDAO(com.tomasio.projects.trainning.dao.AnotacaoDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 7 with AnotacaoDAO

use of com.tomasio.projects.trainning.dao.AnotacaoDAO in project trainning by fernandotomasio.

the class SystemServiceSimpleImpl method findAllAnotacoes.

@Override
@Transactional(readOnly = true)
public AnotacaoDTO[] findAllAnotacoes() {
    AnotacaoDAO dao = factory.getAnotacaoDAO();
    AnotacaoDTO[] anotacoesArray = null;
    try {
        List<AnotacaoDTO> anotacoes = dao.findAll();
        if (anotacoes != null) {
            anotacoesArray = new AnotacaoDTO[anotacoes.size()];
            anotacoes.toArray(anotacoesArray);
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return anotacoesArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AnotacaoDTO(com.tomasio.projects.trainning.dto.AnotacaoDTO) AnotacaoDAO(com.tomasio.projects.trainning.dao.AnotacaoDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

AnotacaoDAO (com.tomasio.projects.trainning.dao.AnotacaoDAO)7 DAOException (com.tomasio.projects.trainning.exception.DAOException)7 AnotacaoDTO (com.tomasio.projects.trainning.dto.AnotacaoDTO)6 CoreException (com.tomasio.projects.trainning.exeption.CoreException)5 Transactional (org.springframework.transaction.annotation.Transactional)5 HibernateAnotacaoDAO (com.tomasio.projects.trainning.dao.HibernateAnotacaoDAO)2 HibernateIndicacaoDAO (com.tomasio.projects.trainning.dao.HibernateIndicacaoDAO)2 HibernateOrganizacaoDAO (com.tomasio.projects.trainning.dao.HibernateOrganizacaoDAO)2 HibernatePessoaDAO (com.tomasio.projects.trainning.dao.HibernatePessoaDAO)2 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)2 OrganizacaoDAO (com.tomasio.projects.trainning.dao.OrganizacaoDAO)2 PessoaDAO (com.tomasio.projects.trainning.dao.PessoaDAO)2 RemoteException (java.rmi.RemoteException)2 ParseException (java.text.ParseException)2 Date (java.util.Date)2