|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sas.framework.expojo.PersistenceProvider
public abstract class PersistenceProvider
Superclass for all persistence providers. This class is extended to provide persistence engine specific implementations. eg., HibernatePersistenceProvider and JdoPersistenceProvider. These objects are typically kept 'open' throughout multiple HTTP requests, for each request a transaction is begun at the start and commited (or rolled back) at the end. This implements the 'OpenSessionInView' (hibernate) or 'OpenPersistenceManagerInView' pattern. A future possible enhancement is to add an optional "free persistence provider' mechanism at the end of each HTTP request.
| Field Summary | |
|---|---|
protected int |
depth
Depth of the deepest transaction. |
ModelExposer |
modelExposer
|
| Constructor Summary | |
|---|---|
PersistenceProvider()
|
|
| Method Summary | |
|---|---|
abstract void |
beginTx()
Begins a transaction. |
abstract void |
close()
Closes the persistence provider. |
abstract void |
commitTx()
Commits a transaction. |
abstract void |
delete(java.lang.Object object)
Deletes the persistent object from the datastore. |
abstract boolean |
hasActiveTx()
Returns true if the PersistenceProvider has an active transaction. |
abstract void |
open()
Opens a persistence provider. |
abstract void |
persist(java.lang.Object object)
Makes the given object persistent. |
abstract java.lang.RuntimeException |
processException(java.lang.RuntimeException e)
Processes an exception thrown while in a transaction. |
abstract void |
rollbackTx()
Rolls back a transaction. |
void |
setModelExposer(ModelExposer iModelExposer)
Sets the owning ModelExposer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient int depth
public ModelExposer modelExposer
| Constructor Detail |
|---|
public PersistenceProvider()
| Method Detail |
|---|
public abstract boolean hasActiveTx()
public void setModelExposer(ModelExposer iModelExposer)
public abstract void open()
public abstract java.lang.RuntimeException processException(java.lang.RuntimeException e)
public abstract void close()
public abstract void delete(java.lang.Object object)
public abstract void persist(java.lang.Object object)
public abstract void rollbackTx()
public abstract void commitTx()
public abstract void beginTx()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||