FileDocCategorySizeDatePackage
CustomInsertSQLWithIdentityColumnTest.javaAPI DocHibernate 3.2.51426Tue May 08 16:56:00 BST 2007org.hibernate.test.sql.hand.identity

CustomInsertSQLWithIdentityColumnTest

public class CustomInsertSQLWithIdentityColumnTest extends org.hibernate.junit.functional.DatabaseSpecificFunctionalTestCase
Custom SQL tests for combined usage of custom insert SQL and identity columns
author
Gail Badner

Fields Summary
Constructors Summary
public CustomInsertSQLWithIdentityColumnTest(String str)

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

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

		return new String[] {"sql/hand/identity/Mappings.hbm.xml"};
	
public static junit.framework.Testsuite()

		return new FunctionalTestClassTestSuite( CustomInsertSQLWithIdentityColumnTest.class );
	
public voidtestBadInsertionFails()

		Session session = openSession();
		session.beginTransaction();
		Organization org = new Organization( "hola!" );
		try {
			session.save( org );
			session.delete( org );
			fail( "expecting bad custom insert statement to fail" );
		}
		catch( JDBCException e ) {
			// expected failure
		}

		session.getTransaction().rollback();
		session.close();