| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.persistence.UOW
The UOW (Unit of Work) is the application developers interface to the persistence layer. Through this all writes, updates and deletes are executed. The UOW also provides the querying mechanism against the persistent store.
| Constructor Summary | |
| UOW()Creates new UOW. | |
| Method Summary | |
|  void | acquireLock(Object object)This will acquire a lock on the database row corrsponding to the input persistent object. | 
|  void | add(Object object)Adds an object to the UOW for addition to the persistent store. | 
|  void | commit()Objects that have been added, objects that have been deleted, and objects that have been updated, will all be persisted via an invocation of this method. | 
|  void | delete(Object object)Adds an object to the UOW for deletion from the persistent store. | 
| protected  void | finalize()This invokes the rollback() method, which will rollback & close the connection(if still open). | 
|  Class | getActualPersistentClass(Object persistentObject)This is a helper method to determine the actual class which was used to create an IPersistent instance. | 
|  boolean | isActive()Returns true if the UOW is active. | 
|  IPersistent | newPersistentInstance(Class persistentClass)Generates an appropriate instance for the input persistentClass. | 
|  Collection | query(Criteria criteria)Queries the underlying persistent store based on the search profile passed in the Criteriaobject. | 
|  void | rollback()Rollbacks all the additions, deletions, updations. | 
|  void | update(Object object)Adds an object to the UOW for updation to the persistent store. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public UOW()
    throws UOWException
UOWException - if any error occurs during the process.| Method Detail | 
public IPersistent newPersistentInstance(Class persistentClass)
persistentClass - The actual persistentClass which can represent a 'Class' or an 'Interface'
public Class getActualPersistentClass(Object persistentObject)
public void add(Object object)
         throws AddFailedException
commit.
object - The object to persist. It should implement the IPersistent interface.
AddFailedException - if any error occurs during the process.
public void update(Object object)
            throws UpdateFailedException
commit.
object - The object to update. It should implement the IPersistent interface.
UpdateFailedException - if any error occurs during the process.
public void delete(Object object)
            throws DeleteFailedException
commit.
object - The object to delete from persistent storage. It should implement the IPersistent interface.
DeleteFailedException - if any error occurs during the process.
public Collection query(Criteria criteria)
                 throws QueryFailedException,
                        PostLoadFailedException
Criteria object.
criteria - search profile for the query.
QueryFailedException - if any error occurs during the process.
PostLoadFailedException - if any error occurs during the invocation of the PostLoad trigger on the persistent object.
public void commit()
            throws AddFailedException,
                   UpdateFailedException,
                   DeleteFailedException,
                   CommitFailedException
AddFailedException - if any error occurs during the addition of objects to the persistent store.
UpdateFailedException - if any error occurs while updating the objects of the persistent store.
DeleteFailedException - if any error occurs while deleting the objects of the persistent store.
CommitFailedException - if any error occurs during the commit.
public void rollback()
              throws RollbackFailedException
RollbackFailedException - if any error occurs during the process.
public void acquireLock(Object object)
                 throws AlreadyLockedObjectException
object - The persistent object to be locked. It should implement the IPersistent interface.
AlreadyLockedObjectException - if the database row has been locked by another process.public boolean isActive()
protected void finalize()
                 throws Throwable
Throwable - if any error occurs.| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||