Code example for Session

Methods: getSessionFactory

0
@ContextConfiguration(locations={ "/org/granite/test/tide/hibernate4/spring/test-context-jpa-hibernate4.xml" }) 
public class TestHibernate4TideLazyLoadingJPA extends AbstractTestTideLazyLoadingJPA { 
	 
	protected void checkSessionsClosed() { 
		Session session = (Session)entityManager.getDelegate();
		Assert.assertEquals("Sessions closed", session.getSessionFactory().getStatistics().getSessionOpenCount(), 
				session.getSessionFactory().getStatistics().getSessionCloseCount());
	} 
}