Code example for SessionFactory

Methods: getCurrentSessionopenSession

0
    public void setUp() throws Exception {
        sf = getSessionFactory();
        dao = new HibernatePersonDao();
        dao.setSessionFactory(sf);
 
        tx = sf.getCurrentSession().beginTransaction();
        tx.begin();
 
        session = sf.getCurrentSession();
        parallel = sf.openSession();
    } 
 
    @After 
    public void tearDown() { 
        if (tx != null) {
            tx.rollback();
        } 
    } 
 
    @Test