package com.rjconsultores.ventaboletos.dao.hibernate;

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.EmpresaContaBancariaDAO;
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;

@Repository("empresaContaBancariaDAO")
public class EmpresaContaBancariaHibernateDAO extends GenericHibernateDAO<EmpresaContaBancaria, Integer> implements EmpresaContaBancariaDAO {

	@Autowired
	public EmpresaContaBancariaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
		setSessionFactory(factory);
	}
	
	@Override
	public EmpresaContaBancaria suscribir(EmpresaContaBancaria entity) throws RuntimeException {
		
		entity = super.suscribir(entity);
		
		getSession().flush();
		return entity;
	}
}
