Code example for Session

Methods: closesavebeginTransaction

0
	 * <p/> 
	 * one hibernate transaction ! 
	 */ 
	private void createMainObject() throws HibernateException {
		Session session = openSession();
		Transaction tx = session.beginTransaction();
 
		MainObject mo = new MainObject();
		mo.setDescription( "Main Test" );
 
		generatedId = session.save( mo );
 
		tx.commit();
		session.close();
	} 
 
	/** 
	 * loads the newly created MainObject 
	 * and adds a new Object2 to it 
	 * <p/>