Code example for SessionFactory

Methods: getCurrentSession

0
		Assert.assertEquals(a.getCashBalance(), 500.0, 0.01);
	} 
	 
	@Test @Transactional
	public void updateAccount() { 
		Session session = sessionFactory.getCurrentSession();
		Query query = session.createQuery("from Account a where a.id=:id").setInteger("id", 1);
		Account a = (Account) query.uniqueResult();
		a.setName("foo");
	} 
	 
} 
Connect your IDE to all the code out there  Get Codota for Java