IOptimizedPersistable Interface |
Namespace: VelocityDb
The IOptimizedPersistable type exposes the following members.
Name | Description | |
---|---|---|
AllowOtherTypesOnSamePage |
By default true but override as returning false so that this type of objects isn't sharing pages with other type of objects.
| |
Cache |
By default, the an object cache is determined by a SessionBase constructor parameter but certain types of objects may be re opened more frequently than others, for such types override this to return a value.
Caching objects this way can cause out of date object references to stay active due to lacking code to invalidate a cached object when referenced objects are replaced.
We will add this automatic invalidation as soon as possible but for now use caution when caching objects. Caching objects that does not strongly reference other objects is OK to do.
| |
FieldsLoaded |
Gets the field members load state. By default, all members are loaded when a persistent object is opened but if an overrode of LazyLoadFields returns true then the object members are loaded by calling [!:OptimizedPersistable.LoadFields] | |
FlushIfPageFull |
By default we flush (write) any updated page we find when looking for an object placement page and the page is considered full (depends on how many objects we permit/page)
| |
Id |
Gets the id of this object. The id is structured as Oid | |
IsPersistent | ||
IsUpdated |
Gets the updated state of the object
| |
LazyLoadFields |
By default all fields are loaded when opening a persistent object but an option is provided to load members on demand (lazy loading).
| |
MaxNumberOfDatabases |
Possibly restrict instances of to a single Database. By default this property is UInt32.MaxValue but classes like BTreeSetOidShort, BTreeMapShortOid ... override this property to return 1 since short references are restricted to a single Database.
| |
ObjectsPerPage |
A default for number of objects per database page used when persisting objects without an explicit Placement object or if persisted using Persist(SessionBase, IOptimizedPersistable, Boolean, Boolean)
This happens when objects are persisted by reachability from a persistent object.
All objects reachable from a persistent object are automatically made persistent.
| |
PagesPerDatabase |
A default for number of objects per database page used when persisting objects without an explicit Placement object or if persisting using Persist(SessionBase, IOptimizedPersistable, Boolean, Boolean)
This happens when objects are persisted by reachability from a persistent object.
All objects reachable from a persistent object are automatically made persistent.
| |
PlacementDatabaseNumber |
Gets the Database Id number to use when placing (persisting) an instance of this class when no other placement directive has been given.
| |
RemovedFromIndices | true if call to [!:Update(bool)] or UpdateObject(IOptimizedPersistable, Boolean, Boolean) caused this object to be removed from possible indices
|
Name | Description | |
---|---|---|
FlushTransients |
Flushes batched up objects such as objects added with AddFast(Key) | |
GetPage |
Get the persistent storage Page of this object
| |
GetTypeVersion |
The database engine needs this internally
| |
GetWrappedObject |
Internally used when IOptimizedPersistable is a wrapper for a non IOptimizedPersistable | |
InitializeAfterRead |
This function is called when an object has been read from disk and all data members (fields) have been loaded. Override this to provide your own initializations of transient data.
| |
InitializeAfterRecreate |
This function is called when an object has been read from disk before all data members (fields) have been fully loaded. Override this to provide your own initializations of transient data.
| |
Persist(SessionBase, IOptimizedPersistable, Boolean, Boolean) |
Persists this object.
| |
Persist(Placement, SessionBase, Boolean, Boolean, QueueIOptimizedPersistable) |
Persists this object.
| |
PersistMyReferences |
Persists references from this object
| |
ReadMe |
Provides a way to customize how an object is read. Used by a code generator
| |
SetPage |
Sets the persistent storage Page of this object
| |
SetTypeVersion |
The database engine needs this internally
| |
ShallowCopyTo |
Copies current object to a page
| |
Unpersist |
Removes an object from the persistent store and makes the object a transient object. It does not automatically make referenced objects unpersisted. Best way to do so is to override this virtual function in your own classes.
| |
Update |
Call this function before updating any fields of this object
| |
WriteMe |
Provides a way to customize how an object is written. Used by a code generator
|