Click or drag to resize

OptimizedPersistable Class

Base class for all persistent capable classes except for embedded objects which do not need to be subclasses of this class.
Inheritance Hierarchy
SystemObject
  VelocityDbOptimizedPersistable
    More...

Namespace:  VelocityDb
Assembly:  VelocityDb (in VelocityDb.dll) Version: 11.1.0.0 (11.1)
Syntax
[SerializableAttribute]
public class OptimizedPersistable : IOptimizedPersistable, 
	IComparable, ICloneable

The OptimizedPersistable type exposes the following members.

Constructors
  NameDescription
Public methodOptimizedPersistable
The default constructor can be used to create simple OptimizedPersistable objects.
Public methodOptimizedPersistable(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.
Top
Properties
  NameDescription
Public propertyAllowOtherTypesOnSamePage
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.
Public propertyCache
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.
Public propertyDatabaseNumber
Gets the database number of this object.
Public propertyFieldsLoaded
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]
Public propertyFlushIfPageFull
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)
Public propertyId
Gets the id of this object. The id is structured as Oid
Public propertyIsPersistent
Gets the persistent state of an object. An object is considered persistent when it has an Oid, that is the Id is not 0
Public propertyIsUpdated
Gets the updated state of the object
Public propertyLazyLoadFields
By default all fields are loaded when opening a persistent object but an option is provided to load members on demand (lazy loading).
Public propertyMaxNumberOfDatabases
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.
Public propertyObjectsPerPage
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.
Public propertyOid
Gets the object identifier represented as an Oid.
Public propertyOidShort
Gets the OidShort part of the object Oid
Public propertyPageNumber
Gets the page number part of the object Oid (Id)
Public propertyPagesPerDatabase
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.
Public propertyPlacementDatabaseNumber
Gets the Database Id number to use when placing (persisting) an instance of this class when no other placement directive has been given.
Public propertyRemovedFromIndices
true if call to [!:Update(bool)] or UpdateObject(IOptimizedPersistable, Boolean, Boolean) caused this object to be removed from possible indices
Public propertyShortId
Gets the short id of this object. The id is structured as OidShort
Public propertySlotNumber
Gets the page number from the object identifier
Top
Methods
  NameDescription
Public methodClone
Public methodCompareTo
Compares objects using the object Id
Public methodEquals
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).)
Public methodFlushTransients
Process data in transient fields (if any), do whatever is required to persist such data if needed. By default does nothing.
Public methodGetDataMembers
Gets a list of the fields meta data objects
Public methodGetFieldValues
Returns a list of field values of this object or returns it as an array (if this is an array)
Public methodGetHashCode
Computes a hash code based on Oid of object. Make sure to persist objects before using GetHashCode() or override GetHashCode()
(Overrides ObjectGetHashCode.)
Public methodGetPage
Get the persistent storage Page of this object
Public methodGetSession
Gets the session of this object or null if this object isn't yet persisted.
Public methodGetTypeVersion
The database engine needs this internally
Public methodGetWrappedObject
Internally used when IOptimizedPersistable is a wrapper for a non IOptimizedPersistable
Public methodInitializeAfterRead
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.
Public methodInitializeAfterRecreate
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.
Public methodStatic memberListToString
This is a support function for the VelocityDbBrowser
Public methodOidOf
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.
Public methodOpen(UInt32, Boolean, Boolean)
Opens a persistent object located in the same Database as this object
Public methodOpenT(UInt32, Boolean, Boolean)
Opens a persistent object located in the same Database as this object
Public methodOptimizedPersistableFieldValues
Gets a list of all field values of the current object that are subclasses of OptimizedPersistable
Public methodPersist(SessionBase, IOptimizedPersistable, Boolean, Boolean)
Persists this object.
Public methodPersist(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.
Public methodPersistentVersion
Gets the page version of a persistent object
Public methodPersistMyReferences
Persists references from this object
Public methodReadMe
Used by code generator
Public methodStatic memberReadMeUsingSchemaReflection
Used by code generator. By default objects are read and written using persisted schema information and reflection.
Public methodSetPage
Sets the persistent storage Page of this object
Public methodSetTypeVersion
The database engine needs this internally
Public methodShallowCopyTo
Internal use for now
Public methodToString
Displays class name plus object id
(Overrides ObjectToString.)
Public methodUnpersist
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.
Public methodUpdate
Marks an object as being updated so that object will be written at commit transaction. Call before making object changes!
Public methodUpdate(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.
Public methodUpdateNonIndexField
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.
Public methodUpdateTypeVersion
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.
Public methodWrite
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.
Public methodWriteMe
Used by code generator.
Public methodStatic memberWriteMeUsingSchemaReflection
Used by code generator. This is the default way of writing objects using schema information and .NET reflection info.
Top
Extension Methods
  NameDescription
Public Extension MethodToStringDetails(SessionBase, Boolean)Overloaded.
Object details as a string
(Defined by Utilities.)
Public Extension MethodToStringDetails(Schema, TypeVersion, Boolean)Overloaded.
Currently only used by Database Manager
(Defined by Utilities.)
Top
See Also
Inheritance Hierarchy
SystemObject
  VelocityDbOptimizedPersistable
    VelocityDb.Collection.BTreeBTreeByteArray
    VelocityDb.Collection.BTreeBTreeNode
    VelocityDb.Collection.ComparerVelocityDbComparerKey
    VelocityDb.CollectionSortedSetBaseKey
    VelocityDb.CollectionVelocityDbHashSetT
    VelocityDb.CollectionVelocityDbListT
    VelocityDb.CollectionWeakReferenceListBaseT
    VelocityDbDatabase
    VelocityDbDatabaseLocation
    VelocityDbDatabaseLocations
    VelocityDb.IndexingIndexDescriptor
    VelocityDb.IndexingIndexes
    VelocityDbLicense
    VelocityDbPageOffset
    VelocityDbPlacement
    VelocityDbReferenceTracked
    VelocityDb.SyncChange
    VelocityDb.SyncChanges
    VelocityDb.SyncReplicaSync
    VelocityDb.SyncTransactionChanges
    VelocityDb.TypeInfoDataMember
    VelocityDb.TypeInfoReference
    VelocityDb.TypeInfoRelation
    VelocityDb.TypeInfoSchema
    VelocityDb.TypeInfoTypeVersion
    VelocityDb.TypeInfoVelocityDbType
    VelocityDBExtensions.CompressedBitArrayEwahCompressedBitArray
    VelocityDBExtensions.CompressedBitArrayRunningLengthWord
    VelocityDBExtensions.SpatialRTree
    VelocityDBExtensions2.AspNet.IdentityAspNetIdentity
    VelocityDBExtensions2.AspNet.IdentityIdentityRole
    VelocityDBExtensions2.AspNet.IdentityIdentityUser
    VelocityDBExtensions2.AspNet.IdentityUserLoginInfoAdapter
    VelocityGraphEdgeType
    VelocityGraphGraph
    VelocityGraphPropertyType
    VelocityGraphVertexType