Code example for Session

Methods: closegetbeginTransaction

0
 
		assertInsertCount(2); 
		assertUpdateCount(0); 
 
		s = openSession();
		tx = s.beginTransaction();
		root = (NumberedNode) s.get( NumberedNode.class, Long.valueOf( root.getId() ) );
		NumberedNode child2 = new NumberedNode("child2");
		root.addChild(child2);
		tx.commit();
		s.close();
 
		assertInsertCount(3); 
		assertUpdateCount(0); 
	} 
 
	@Test
	public void testCreateException() { 
		Session s = openSession();
		Transaction tx = s.beginTransaction();