Class Vapor::PersistenceManager
|
|
Central interface to the VAPOR framework. Manages Persistable objects.
Exceptions
Initialize a new PersistenceManager.
properties is a Hash-like object responding to
[key]. For unknown keys, it should return nil. Keys used
by the PersistenceManager are:
Vapor.Datastore.Username: | Username used to authenticate connection to Datastore
|
Vapor.Datastore.Password: | Password used to authenticate connection to Datastore
|
Vapor.Datastore.Name: | Name of the Datastore
|
Vapor.Datastore.Host: | Hostname where the Datastore resides
|
Vapor.Datastore.Port: | optional, Port used to connect to host where Datastore resides
|
Vapor.Autocommit: | optionalIf Autocommmit-Mode should be set on startup. Defaults to
true if unspecified. All values other then false or
nil are treated as true.
|
Vapor.Datastore.BackendClass: | optional, Class used to access Datastore, defaults to
TupleManager, don’t specify anything unless absolutely sure
|
Transaction instance asssociated with the PersistenceManager. When the optional
block is given, pass it to Transaction#do.
PersistenceManager#transaction{|t| …} is equivalent to
PersistenceManager#transaction.do{|t| …}.
Returns the Persistable with the specific
OID from the Repository.
Returns an archived version of a persistent object of the specified klass,
oid and revision. The object’s satate is READONLY and thus
non-modifiable. Returns nil if such an object (either the klass, the oid or
the version ) can’t be found. The returned objects are not cached and
two different objects are returned when the method is called twice with the
same arguments.
Returns an Extent containing all instances of a
the Persistable Class. If
subclasses is true, the Extent
will contain all instances of persistable subclasses of the Class.
Retursn an previouslyu unused, unique OID.
Iterator over all all persistent objects.
Search for persistent objects of a specific class in the Repository.
Returns an Extent containing the objects matching
the query, empty if none match. Result will include instances of subclasses
matching the query, too, if subclasses is true.
Returns true if Autocommit-Mode is turned on.
Set status of Autocommit-Mode. Flushes all previous changes when setting to
true. All subsequent changes will be flushed immediatly.
Returns true if a microtransaction of an Autocommit is in
progress.