Code example for Session

Methods: closebeginTransactioncreateQuery

0
		assertInsertCount(2); 
		assertUpdateCount(0); 
		clearCounts(); 
 
		s = openSession();
		tx = s.beginTransaction();
		s.createQuery("delete from NumberedNode where name like 'grand%'").executeUpdate();
		s.createQuery("delete from NumberedNode where name like 'child%'").executeUpdate();
		s.createQuery("delete from NumberedNode").executeUpdate();
		tx.commit();
		s.close();
	} 
 
	@Test
	public void testMergeTree() { 
		clearCounts(); 
 
		Session s = openSession();
		Transaction tx = s.beginTransaction();
		Node root = new Node("root");