OptimizedPersistable Class |
Namespace: VelocityDb
The OptimizedPersistable type exposes the following members.
Name | Description | |
---|---|---|
OptimizedPersistable |
The default constructor can be used to create simple OptimizedPersistable objects.
| |
OptimizedPersistable(UInt64) |
This constructor can be used in cases where the object id is known but you don't want to open the object, maybe you just want to add this object to a BTreeSet.
|
Name | Description | |
---|---|---|
AllowOtherTypesOnSamePage |
Objects can be stored more efficiently if all object types on the page share the same type. By default mixed types are allowed. Override this to return false for types that should not share pages with other types.
| |
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.
| |
DatabaseNumber |
Gets the database number of this object.
| |
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.
| |
Oid |
Gets the object identifier represented as an Oid.
| |
OidShort |
Gets the OidShort part of the object Oid
| |
PageNumber |
Gets the page number part of the object Oid (Id)
| |
PagesPerDatabase |
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.
| |
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
| |
ShortId |
Gets the short id of this object. The id is structured as OidShort | |
SlotNumber |
Gets the page number from the object identifier
|
Name | Description | |
---|---|---|
Clone |
See MemberwiseClone | |
CompareTo |
Compares objects using the object Id | |
Equals |
Determines whether the specified Object is equal to the current Object. If this object or other object isn't persistent we call Equals(Object) (Overrides ObjectEquals(Object).) | |
FlushTransients |
Process data in transient fields (if any), do whatever is required to persist such data if needed. By default does nothing.
| |
GetDataMembers |
Gets a list of the fields meta data objects
| |
GetFieldValues |
Returns a list of field values of this object or returns it as an array (if this is an array)
| |
GetHashCode |
Computes a hash code based on Oid of object.
Make sure to persist objects before using GetHashCode() or override GetHashCode()
(Overrides ObjectGetHashCode.) | |
GetPage |
Get the persistent storage Page of this object
| |
GetSession |
Gets the session of this object or null if this object isn't yet persisted.
| |
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.
| |
ListToString |
This is a support function for the VelocityDbBrowser
| |
OidOf | Gets the Oid (encoded as an UInt64) of a non OptimizedPersistable object or 0 if the object isn't persistent on the same page as this object. | |
Open(UInt32, Boolean, Boolean) |
Opens a persistent object located in the same Database as this object
| |
OpenT(UInt32, Boolean, Boolean) |
Opens a persistent object located in the same Database as this object
| |
OptimizedPersistableFieldValues |
Gets a list of all field values of the current object that are subclasses of OptimizedPersistable
| |
Persist(SessionBase, IOptimizedPersistable, Boolean, Boolean) |
Persists this object.
| |
Persist(Placement, SessionBase, Boolean, Boolean, QueueIOptimizedPersistable) |
Persists this object. Override in your subclasses when you want fields of your class to be persisted in some special way.
| |
PersistentVersion |
Gets the page version of a persistent object
| |
PersistMyReferences |
Persists references from this object
| |
ReadMe |
Used by code generator
| |
ReadMeUsingSchemaReflection |
Used by code generator. By default objects are read and written using persisted schema information and reflection.
| |
SetPage |
Sets the persistent storage Page of this object
| |
SetTypeVersion |
The database engine needs this internally
| |
ShallowCopyTo |
Internal use for now
| |
ToString |
Displays class name plus object id
(Overrides ObjectToString.) | |
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 |
Marks an object as being updated so that object will be written at commit transaction. Call before making object changes!
| |
Update(Action) |
Marks an object as being updated so that object will be written at commit transaction. Call before making object changes! Add code to update object in Action parameter.
| |
UpdateNonIndexField |
Marks an object as being updated so that object will be written at commit transaction. Call before updating a NON indexed field.
Same as Update but avoids deleting object from indices (if any). If updating a field used in any index, call Update instead
or you may end up with one or more corrupt indices.
| |
UpdateTypeVersion |
Updates the object and make this object use the latest Type definition for its class. The object now will now adjust for data attribute changes.
| |
Write |
By calling this you force a persisted (has an Id) object to be written to disk (if updated) and indices (if any) to be updated. Other objects on the same page will also be written.
| |
WriteMe |
Used by code generator.
| |
WriteMeUsingSchemaReflection |
Used by code generator. This is the default way of writing objects using schema information and .NET reflection info.
|
Name | Description | |
---|---|---|
ToStringDetails(SessionBase, Boolean) | Overloaded.
Object details as a string
(Defined by Utilities.) | |
ToStringDetails(Schema, TypeVersion, Boolean) | Overloaded.
Currently only used by Database Manager
(Defined by Utilities.) |