Module Vapor::Persistable
|
|
Mix-in providing classses with the ability to be persistently stored in a
VAPOR Repository. Metadata about the class must be registered with the
Repository before actual objects can be made persistent.
Exceptions
Returns true if the object is stored in the Repository and has not
changed after being synched with the Repository.
Returns true if the object’s state is READONLY. Normally,
objects in this state are of archive copys of older revisions.
Returns String containing current persistence status.
Object-ID, nil if object is transient
Revision number of the object. Starts with 0 when the object is
initially made persistent and is increased by one, each time changes to it
are committed. Returns nil if the object is transient.
TransactionLog object that describes the
transaction that made the last changes to the object, creating the current
version of it.
Make an transient object persistent. Raises an ObjectAlreadyPersistentError
if the object is not transient and a RepositoryOfflineError if no PersistenceManager has been
instantiated.
Mark an object to be deleted from the repository. The object will still
exist in memory; it is only ‘detached’ from the repository,
losing it’s persistent identitiy (OID) when the transaction is
flushed. Does nothing if the object is TRANSIENT.
Mark an object as dirty. It will be saved when the transaction commits,
which might be instantly if Auto-Commit mode is set. Call this method when
the value of an persistent attribute has changed, preferably from setters.
Does nothing if the object is TRANSIENT.
Refresh values of object’s persistent attributes to current values in
Datastore, setting the object’s state to PERSISTENT. Transient
attributes are not touched. Does nothing if the object is transient or new.
Raises a DeletedObjectError if the object can not be found in the
Datastore. Does nothing if the object is TRANSIENT.
Retrieve an persistently archived version of self. Returns
<code>nil</code> if a version with said revision mumber does
not exist or the object is not persistent. The returned object is an Persistable in the state READONLY.
old_revision( revision_number )
|