The DatabaseObjectLockable type exposes the following members.

Constructors

  Name Description
Protected method DatabaseObjectLockable
Initializes a new DatabaseObject with the parent collection that this object is associated with and the lock controller to be used with this object.

Methods

  Name Description
Protected method Delete
Deletes the record from the database associated with this record. After which this object becomes invalid. The IsSaved property is automtically set to false. Performs the same function as IDatabaseObjects.ObjectDelete().
(Inherited from DatabaseObject.)
Public method Equals
Compares whether two objects are equal using the distinct values of each object. Specifically, true is returned if the distinct values match, both objects are not Nothing and both object types are the same.
(Inherited from DatabaseObject.)
Protected method Finalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Protected method GetFieldValue
Gets and returns the field value from the database record associated with this object. Returns DBNull.Value if the field is NULL.
(Inherited from DatabaseObject.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected method Load(IDataReader)
Loads this object with the object's fields and properties with the fields from the database. Automatically sets the IDatabaseObject.DistinctValue and IDatabaseObject.IsSaved properties so that the object is correctly initialized. Onforwards a call to Database.ObjectLoad()
(Inherited from DatabaseObject.)
Protected method Load(SQLFieldValues)
Loads this object with the object's fields and properties with the fields from the database. Automatically sets the IDatabaseObject.DistinctValue and IDatabaseObject.IsSaved properties so that the object is correctly initialized. Onforwards a call to Database.ObjectLoad()
(Inherited from DatabaseObject.)
Protected method LoadFields
Sets the properties and fields marked with the FieldMappingAttribute with the values from the database record. Properties or fields that are an enum data type are automatically converted from the database integer value to the equivalent enum. For properties and fields marked with the FieldMappingObjectHookAttribute the property's or field's object is also traversed for properties or fields marked with the FieldMappingAttribute. Loads the lowest order base class that does not exist in the DatabaseObjects assembly first up through to the highest order class. This function should generally not be called from an inheritor. Use LoadFieldValues() to correctly load this object from a set of field values.
(Inherited from DatabaseObject.)
Public method Lock
Locks this object. Throws an exception if this object is already locked. Throws an exception if this object has not been saved. It is possible that between calling IsLocked and Lock another user may have locked the object. Therefore, it is recommended calling Lock and then trapping the MethodAccessException to determine whether the lock actually succeeded.
Protected method LockRecord
Locks the database record associated with this object by selecting and locking the row in the database. Supported in Microsoft SQLServer, Pervasive and MySQL. The record lock is released when the transaction is committed or rolled back. Throws an exception if not in transaction mode. Returns the field values from the record that has been locked.
(Inherited from DatabaseObject.)
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected method MemberwiseCopy(DatabaseObject)
Performs a shallow memberwise copy of fields in this and all base classes, but does not copy any of the DatabaseObjects fields ensuring that the objects are not considered equal.
(Inherited from DatabaseObject.)
Protected method MemberwiseCopy(DatabaseObject, Boolean)
Performs a shallow memberwise copy of fields in this and all base classes, but does not copy any of the DatabaseObjects fields ensuring that the objects are not considered equal.
(Inherited from DatabaseObject.)
Protected method RootContainer<(Of <<'(TRootContainer>)>>)
Returns the root container object that this object is a child of.
(Inherited from DatabaseObject.)
Protected method Save
Extracts the fields to save to the database from the objItem.SaveFields function. The fields are then written to the database using either an SQL INSERT or UPDATE depending on whether the object has already been saved. If the collection has implemented IDatabaseObjects.KeyFieldName then objItem's key is also validated to ensure it is not null and unique within the collection. If the parent collection has implemented Subset then this object should exist within the parent collection. If not, a duplicate key error may occur if the key is being used in another subset in the same table. If a record is being amended (MyBase.IsSaved is True) then the function will "AND" the parent collection's Subset conditions and the DistinctValue value to create the WHERE clause in the UPDATE statement. Therefore, the combination of the IDatabaseObjects.Subset and IDatabaseObject.DistinctValue conditions MUST identify only one record in the table. Otherwise multiple records will be updated with the same data. If data is only inserted and not amended (usually a rare occurance) then this requirement is unnecessary.
(Inherited from DatabaseObject.)
Protected method SaveFields
Gets the values from the properties and fields marked with the FieldMappingAttribute to be saved to the database. Properties or fields that return an enum data type are automatically converted from the enum to the equivalent integer value for database storage. For properties and fields marked with the FieldMappingObjectHookAttribute the property's or field's object is also traversed for properties or fields marked with the FieldMappingAttribute.
(Inherited from DatabaseObject.)
Protected method SetFieldValue
Sets the field value for the database record associated with this object.
(Inherited from DatabaseObject.)
Public method ToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public method UnLock
UnLocks this object. Throws an exception if the object is not locked or the object has not been saved.

Properties

  Name Description
Protected property DistinctValue
Returns the distinct value that uniquely identifies this object in the database. If a new object is saved or an existing object is loaded then this property is automatically set by the library. Typically, this is the value of an identity or auto increment database field.
(Inherited from DatabaseObject.)
Protected property GrandParent
Returns the grand parent of this object. This is usually the object that contains the collection that this object is contained with in. For example, a GrandParent object of an InvoiceDetail would be an Invoice.
(Inherited from DatabaseObject.)
Protected property GrandParentDistinctValue
Returns the distinct value from the grand parent of this object. This is usually the object that contains the collection that this object is contained within. For example, a GrandParent object of an InvoiceDetail would be an Invoice.
(Inherited from DatabaseObject.)
Public property IsLocked
Indicates whether the current object is Locked either by the current user or another user.
Public property IsLockedByCurrentUser
Returns whether the current user has the object locked.
Protected property IsSaved
Returns whether this object has been saved to the database. If a new object is saved (which uses an auto increment field) or an existing object is loaded then this property is automatically set to true by the library.
(Inherited from DatabaseObject.)
Protected property LockedByUserID
Returns the user identifier that currently has the object locked. Throws an exception if the object is not locked by a user.
Protected property ParentCollection
Sets/returns the parent collection (DatabaseObjects instance) that this object is associated with.
(Inherited from DatabaseObject.)
Protected property ParentDatabase
Returns the database associated with this object.
(Inherited from DatabaseObject.)

See Also