FileDocCategorySizeDatePackage
AbstractJPATest.javaAPI DocHibernate 3.2.55092Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.jpa

AbstractJPATest

public class AbstractJPATest extends org.hibernate.junit.functional.FunctionalTestCase
An abstract test for all JPA spec related tests.
author
Steve Ebersole

Fields Summary
Constructors Summary
public AbstractJPATest(String name)

		super( name );
	
Methods Summary
protected org.hibernate.event.AutoFlushEventListener[]buildAutoFlushEventListeners()

		return new AutoFlushEventListener[] { JPAAutoFlushEventListener.INSTANCE };
	
protected org.hibernate.event.FlushEntityEventListener[]buildFlushEntityEventListeners()

		return new FlushEntityEventListener[] { new JPAFlushEntityEventListener() };
	
protected org.hibernate.event.FlushEventListener[]buildFlushEventListeners()

		return new FlushEventListener[] { JPAFlushEventListener.INSTANCE };
	
protected org.hibernate.event.PersistEventListener[]buildPersisOnFlushEventListeners()

		return new PersistEventListener[] { new JPAPersistOnFlushEventListener() };
	
protected org.hibernate.event.PersistEventListener[]buildPersistEventListeners()

		return new PersistEventListener[] { new JPAPersistEventListener() };
	
public voidconfigure(org.hibernate.cfg.Configuration cfg)

		super.configure( cfg );
		cfg.setProperty( Environment.JPAQL_STRICT_COMPLIANCE, "true" );
		cfg.setProperty( Environment.USE_SECOND_LEVEL_CACHE, "false" );
		cfg.setEntityNotFoundDelegate( new JPAEntityNotFoundDelegate() );
		cfg.getEventListeners().setPersistEventListeners( buildPersistEventListeners() );
		cfg.getEventListeners().setPersistOnFlushEventListeners( buildPersisOnFlushEventListeners() );
		cfg.getEventListeners().setAutoFlushEventListeners( buildAutoFlushEventListeners() );
		cfg.getEventListeners().setFlushEventListeners( buildFlushEventListeners() );
		cfg.getEventListeners().setFlushEntityEventListeners( buildFlushEntityEventListeners() );
	
public java.lang.StringgetCacheConcurrencyStrategy()

		// no second level caching
		return null;
	
public java.lang.String[]getMappings()

		return new String[] { "jpa/Part.hbm.xml", "jpa/Item.hbm.xml", "jpa/MyEntity.hbm.xml" };