com.sas.framework.expojo.jdo
Class JdoPersistenceProvider

java.lang.Object
  extended by com.sas.framework.expojo.PersistenceProvider
      extended by com.sas.framework.expojo.jdo.JdoPersistenceProvider

public class JdoPersistenceProvider
extends PersistenceProvider

Provides facilities for accessing transparent persistence via a JDO compliant persistence engine.


Field Summary
protected  PersistenceManager pm
          Stores a reference to the persistence manager.
protected  PersistenceManagerFactory pmf
          JDO persistence manager factory object.
 
Fields inherited from class com.sas.framework.expojo.PersistenceProvider
depth, modelExposer
 
Constructor Summary
JdoPersistenceProvider(PersistenceManagerFactory iPmf)
          Constructs the object.
 
Method Summary
 void beginTx()
          Begins a transaction.
 void close()
          Closes the persistence provider.
 void commitTx()
          Commits a transaction.
 void delete(java.lang.Object object)
          Deletes the persistent object from the datastore.
 PersistenceManager getPm()
          Returns pm
 boolean hasActiveTx()
          Returns true if the PersistenceProvider has an active transaction.
 void open()
          Opens a persistence provider.
 void persist(java.lang.Object object)
          Makes the given object persistent.
 java.lang.RuntimeException processException(java.lang.RuntimeException e)
          Processes an exception thrown while in a transaction.
 void rollbackTx()
          Rolls back a transaction.
 void setPm(PersistenceManager pm)
          Sets pm
 
Methods inherited from class com.sas.framework.expojo.PersistenceProvider
setModelExposer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pm

protected transient PersistenceManager pm
Stores a reference to the persistence manager.


pmf

protected transient PersistenceManagerFactory pmf
JDO persistence manager factory object. Uses this in 'open' to create a persistence manager.

Constructor Detail

JdoPersistenceProvider

public JdoPersistenceProvider(PersistenceManagerFactory iPmf)
Constructs the object.

Method Detail

hasActiveTx

public boolean hasActiveTx()
Returns true if the PersistenceProvider has an active transaction.

Specified by:
hasActiveTx in class PersistenceProvider

open

public void open()
Opens a persistence provider.

Specified by:
open in class PersistenceProvider

processException

public java.lang.RuntimeException processException(java.lang.RuntimeException e)
Processes an exception thrown while in a transaction. The exception could be relevent to the persistence technology or a generic RuntimeException. If it's an optimistic verification exception (optimistic locking check failed) then no exception is thrown and the persistence technology may or may not need clean. In the case of JDO a rollback as already been performed.

Specified by:
processException in class PersistenceProvider

close

public void close()
Closes the persistence provider. It can no longer be used after being closed.

Specified by:
close in class PersistenceProvider

delete

public void delete(java.lang.Object object)
Deletes the persistent object from the datastore.

Specified by:
delete in class PersistenceProvider

persist

public void persist(java.lang.Object object)
Makes the given object persistent.

Specified by:
persist in class PersistenceProvider

setPm

public void setPm(PersistenceManager pm)
Sets pm


getPm

public PersistenceManager getPm()
Returns pm


rollbackTx

public void rollbackTx()
Rolls back a transaction.

Specified by:
rollbackTx in class PersistenceProvider

commitTx

public void commitTx()
Commits a transaction.

Specified by:
commitTx in class PersistenceProvider

beginTx

public void beginTx()
Begins a transaction.

Specified by:
beginTx in class PersistenceProvider