package com.rjconsultores.ventaboletos.dao.hibernate;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.rjconsultores.ventaboletos.dao.LogAuditoriaDAO;
import com.rjconsultores.ventaboletos.entidad.LogAuditoria;

@Repository("LogAuditoriaDAO")
public class LogAuditoriaHibernateDAO extends GenericHibernateDAO<LogAuditoria, Long> implements LogAuditoriaDAO {
	
	@Autowired
    public LogAuditoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
        setSessionFactory(factory);
    }

	@Override
	@SuppressWarnings("unchecked")
	public List<String> listarTodasAsTelas() {
		Query query = getSession().createSQLQuery("select tela from log_auditoria where activo = 1 group by tela");
		List<String> lista = query.list();
		return lista;
	}

}
