package br.com.centralit.citcorpore.negocio;

import java.util.Collection;

import br.com.centralit.citcorpore.bean.SmartDecisionsWidgetsDTO;
import br.com.centralit.citcorpore.integracao.SmartDecisionsWidgetsDAO;
import br.com.citframework.service.CrudServiceImpl;

@SuppressWarnings("unchecked")
public class SmartDecisionsWidgetsServiceEjb extends CrudServiceImpl implements SmartDecisionsWidgetsService {

	private SmartDecisionsWidgetsDAO dao;

	@Override
	protected SmartDecisionsWidgetsDAO getDao() {
		if (dao == null) {
			dao = new SmartDecisionsWidgetsDAO();
		}
		return dao;
	}

	@Override
	public void updateNotNull(SmartDecisionsWidgetsDTO smartDecisionsWidgetsDTO) throws Exception {
		this.getDao().updateNotNull(smartDecisionsWidgetsDTO);
	}

	@Override
	public Collection<SmartDecisionsWidgetsDTO> findByIdUsuario(Integer idUsuario) throws Exception {
		return this.getDao().findByIdUsuario(idUsuario);
	}

	@Override
	public Collection<SmartDecisionsWidgetsDTO> findByIdUsuarioAndIdPanel(Integer idUsuario, Integer idPanel) throws Exception {
		return this.getDao().findByIdUsuarioAndIdPanel(idUsuario, idPanel);
	}

}
