FileDocCategorySizeDatePackage
SelectGeneratorTest.javaAPI DocHibernate 3.2.51601Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.generatedkeys.select

SelectGeneratorTest

public class SelectGeneratorTest extends org.hibernate.junit.functional.DatabaseSpecificFunctionalTestCase
author
Steve Ebersole

Fields Summary
Constructors Summary
public SelectGeneratorTest(String x)

		super( x );
	
Methods Summary
public booleanappliesTo(org.hibernate.dialect.Dialect dialect)

		return ( dialect instanceof Oracle9Dialect );
	
public java.lang.String[]getMappings()

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

		return new FunctionalTestClassTestSuite( SelectGeneratorTest.class );
	
public voidtestJDBC3GetGeneratedKeysSupportOnOracle()

		if ( getDialect() instanceof DataDirectOracle9Dialect ) {
			reportSkip( "DataDirect drivers known to not support JDBC3 getGeneratedKeys for Oracle", "oracle getGeneratedKeys support" );
			return;
		}
		Session session = openSession();
		session.beginTransaction();

		MyEntity e = new MyEntity( "entity-1" );
		session.save( e );

		// this insert should happen immediately!
		assertEquals( "id not generated through forced insertion", new Long(1), e.getId() );

		session.delete( e );
		session.getTransaction().commit();
		session.close();