public abstract class AbstractBaseDao {
@Autowired
private SessionFactory sessionFactory;
/**
* mybatis的sqlSessionFactory
*/
@Autowired
private SqlSessionFactory sqlSessionFactory;
protected Session getSession() {
return sessionFactory.getCurrentSession();
}
protected SqlSession getSqlSession() {
return sqlSessionFactory.openSession();
}
}
集成mybatis和hibernate的sessionFactory和sqlSessionFactory的类
最新推荐文章于 2020-01-08 13:42:06 发布