package br.com.centralit.citcorpore.negocio;

import java.util.Collection;

import br.com.centralit.citcorpore.bean.OcorrenciaServicoServicoApoioDTO;
import br.com.centralit.citcorpore.integracao.OcorrenciaServicoServicoApoioDAO;
import br.com.citframework.excecao.ServiceException;
import br.com.citframework.service.CrudServiceImpl;

@SuppressWarnings("unchecked")
public class OcorrenciaServicoServicoApoioServiceEjb extends CrudServiceImpl implements OcorrenciaServicoServicoApoioService{

	private OcorrenciaServicoServicoApoioDAO OcorrenciaServicoServicoApoioDAO;
	
	@Override
	protected OcorrenciaServicoServicoApoioDAO getDao() {
		if (this.OcorrenciaServicoServicoApoioDAO == null) {
			this.OcorrenciaServicoServicoApoioDAO = new OcorrenciaServicoServicoApoioDAO();
		}
		return this.OcorrenciaServicoServicoApoioDAO;
	}

	@Override
	public Collection<OcorrenciaServicoServicoApoioDTO> findOcorrenciaServicoServicoApoioByIdOcorrenciaServico(
			Integer idOcorrenciaServico) throws Exception {
		try {
			return this.getDao().findOcorrenciaServicoServicoApoioByIdOcorrenciaServico(idOcorrenciaServico);
		} catch (Exception e) {
			throw new ServiceException(e);
		}
	}

	@Override
	public void createOcorrenciaServicoServicoApoio(Integer idOcorrenciaServico) throws Exception {
		try {
			this.getDao().createOcorrenciaServicoServicoApoio(idOcorrenciaServico);
		} catch (Exception e) {
			throw new ServiceException(e);
		}		
	}
	
}
