| org.jaffa.persistence.engines.IPersistenceEngine
All known Subclasses: org.jaffa.persistence.engines.jdbcengine.Engine,
IPersistenceEngine | public interface IPersistenceEngine (Code) | | The interface for a Persistence Engine.
|
Method Summary | |
public void | acquireLock(IPersistent object) This will acquire a lock on the database row corrsponding to the input persistent object. | public void | add(IPersistent object) Adds an object to the persistent store. | public void | close() Frees up the connection to the database. | public 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. | public void | delete(IPersistent object) Deletes an object from the persistent store. | public Class | getActualPersistentClass(Object persistentObject) This is a helper method to determine the actual class which was used to create an IPersistent instance.
It is quite possible that the input object is a dynamic proxy.
Parameters: object - The object which implements the IPersistent instance. | public IPersistent | newPersistentInstance(Class persistentClass) Generates an appropriate instance for the input persistentClass.
If the persistentClass is a 'Class', then it should implement the 'IPersistent' interface. | public Collection | query(Criteria criteria) Queries the underlying persistent store based on the search profile passed in the Criteria object.
Parameters: criteria - search profile for the query. | public void | rollback() Rollbacks all the additions, deletions, updations. | public void | update(IPersistent object) Updates an object from the persistent store. |
add | public void add(IPersistent object) throws AddFailedException(Code) | | Adds an object to the persistent store.
The persistence engine may choose to add the object(s) only on a commit .
Parameters: object - The object to persist. throws: AddFailedException - if any error occurs during the process. |
close | public void close()(Code) | | Frees up the connection to the database.
|
delete | public void delete(IPersistent object) throws DeleteFailedException(Code) | | Deletes an object from the persistent store.
The persistence engine may choose to delete the object(s) only on a commit .
Parameters: object - The object to delete from persistent storage. throws: DeleteFailedException - if any error occurs during the process. |
getActualPersistentClass | public Class getActualPersistentClass(Object persistentObject)(Code) | | This is a helper method to determine the actual class which was used to create an IPersistent instance.
It is quite possible that the input object is a dynamic proxy.
Parameters: object - The object which implements the IPersistent instance. The class which was used for instantiating the instance. |
newPersistentInstance | public IPersistent newPersistentInstance(Class persistentClass)(Code) | | Generates an appropriate instance for the input persistentClass.
If the persistentClass is a 'Class', then it should implement the 'IPersistent' interface. The persistence engine will simply instantiate the class.
If the persistentClass is an 'Interface', then the persistence engine will generate a dynamic proxy, to implement the IPersistent and the 'persistentClass' interfaces.
Parameters: persistentClass - The actual persistentClass which can represent a 'Class' or an 'Interface' an instance implementing the IPersistent interface. |
update | public void update(IPersistent object) throws UpdateFailedException(Code) | | Updates an object from the persistent store.
The persistence engine may choose to update the object(s) only on a commit .
Parameters: object - The object to update. throws: UpdateFailedException - if any error occurs during the process. |
|
|