com.sas.framework.expojo
Class PersistenceProviderFactory

java.lang.Object
  extended by com.sas.framework.expojo.PersistenceProviderFactory
Direct Known Subclasses:
HibernatePersistenceProviderFactory, JdoPersistenceProviderFactory, MockPersistenceProviderFactory

public abstract class PersistenceProviderFactory
extends java.lang.Object

Superclass for all persistence provider factories. These will provide an appropriate PersistenceProvider on request.


Field Summary
protected  boolean testDb
          True if dealing with a test database.
 
Constructor Summary
PersistenceProviderFactory()
           
 
Method Summary
 void close()
          Describe here
abstract  PersistenceProvider createPersistenceProvider()
          Overridden in derived classes to provide PersistenceProvider appropriate to the persistence technology used.
 boolean isTestDb()
          Returns testDb
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testDb

protected transient boolean testDb
True if dealing with a test database. By convention make sure any test database has the word 'test' in its URL. When initializing the persistence technology in the derived class be sure to call setTestDb according to whether the URL contains 'test' in it. This is not used by the model exposer itself but can be used by other classes to know whether they are dealing with a test database or not. The PersistenceTestCase uses this valid to assert that it is only operating on test databases. Adding and removing objects from a live production system could have detrimental affects on the data store especially when the destroyTestObjects method removes all objects from the database!

Constructor Detail

PersistenceProviderFactory

public PersistenceProviderFactory()
Method Detail

close

public void close()
Describe here


isTestDb

public boolean isTestDb()
Returns testDb


createPersistenceProvider

public abstract PersistenceProvider createPersistenceProvider()
Overridden in derived classes to provide PersistenceProvider appropriate to the persistence technology used.