FileDocCategorySizeDatePackage
UseIdentifierRollbackTest.javaAPI DocHibernate 3.2.51113Thu Mar 22 08:56:42 GMT 2007org.hibernate.test.id

UseIdentifierRollbackTest

public class UseIdentifierRollbackTest extends org.hibernate.test.TestCase
author
Emmanuel Bernard

Fields Summary
Constructors Summary
public UseIdentifierRollbackTest(String str)

		super(str);
	
Methods Summary
public voidconfigure(org.hibernate.cfg.Configuration cfg)

		cfg.setProperty( Environment.USE_IDENTIFIER_ROLLBACK, "true");
		super.configure( cfg );
	
public java.lang.String[]getMappings()

		return new String[] { "id/Product.hbm.xml" };
	
public static junit.framework.Testsuite()

		return new FunctionalTestClassTestSuite( UseIdentifierRollbackTest.class );
	
public voidtestSimpleRollback()

		Session session = openSession();
		Transaction t = session.beginTransaction();
		Product prod = new Product();
		assertNull( prod.getName() );
		session.persist(prod);
		session.flush();
		assertNotNull( prod.getName() );
		t.rollback();
		session.close();