The DatabaseObjectsVolatileList<(Of <(<'T>)>)> type exposes the following members.

Constructors

  Name Description
Protected method DatabaseObjectsVolatileList<(Of <(<'T>)>)>(Database)
Initializes a new instance with it's associated database.
Protected method DatabaseObjectsVolatileList<(Of <(<'T>)>)>(DatabaseObject)
Initializes a new instance with the parent that it is associated with.
Protected method DatabaseObjectsVolatileList<(Of <(<'T>)>)>(RootContainer)
Initializes with it the associated root container and database.
Protected method DatabaseObjectsVolatileList<(Of <(<'T>)>)>(Database, Object)
Initializes a new instance with it's associated database and data that can be used for specifying a subset.

Methods

  Name Description
Public method Add
Creates and returns a new object which has been added to the in-memory list.
Public method Delete
Removes the item from the in-memory list, and flags the item to be deleted.
Protected method DistinctFieldAutoAssignment
Should return whether the Distinct field as specified in the associated collection's DatabaseObject.DistinctField is an identity field (Autonumber in Microsoft Access) or is a unique identifier field. If set to either value then the IDatabaseObject.DistinctValue value is automatically set when a new object is saved.
(Inherited from DatabaseObjects.)
Protected method DistinctFieldAutoIncrements Obsolete.
Should return whether the Distinct field as specified in the associated collection's DatabaseObject.DistinctField is an identity field (Autonumber in Microsoft Access). If set to true, then the DatabaseObject.DistinctValue value is set when a new object is saved.
(Inherited from DatabaseObjects.)
Protected method DistinctFieldName
Should return the field name that uniquely identifies each object within the collection. Typically, this is the field name of an identity or auto increment field. If the DatabaseObjects.SubSet function has been implemented then the DistinctFieldName need only be unique within the subset not the entire table. The DistinctFieldName and KeyFieldName can be identical. This function should almost always be implemented.
(Inherited from DatabaseObjects.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
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.)
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 ItemInstance
Should return an instance of the class that is associated with this collection of objects. The associated class must implement the IDatabaseObject interface. Typically, a DatabaseObject (implements IDatabaseObject) instance is returned from this function.
(Inherited from DatabaseObjects.)
Protected method ItemInstance_
Should return an instance of the class that is associated with this collection of objects. This is the generic version of the ItemInstance function. It is suffixed with an underscore so that it does not conflict with the underlying non-generic equivalent ItemInstance function. It's purpose is indentical to the non-generic version.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected method KeyFieldName
This property should return the field name that uniquely identifies each object within the collection. As opposed to the ordinal/index position, the key field provides another method of accessing a particular object within the collection. The key field must be unique within the collection. If the DatabaseObjects.Subset function has been implemented then the key field only needs to be unique within the specified subset, not the entire table. Implementing this function is optional.
(Inherited from DatabaseObjects.)
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected method Object
Returns an instance of an object from this collection using a distinct value as specified by DistinctFieldName. If Subset has been implemented then the objDistinctValue need only be unique within the subset specified, not the entire database table.
(Inherited from DatabaseObjects.)
Protected method ObjectByKey
Returns an object using a unique key value. The key must be unique within this collection. If the collection's DatabaseObjects.Subset has been implemented then the key need only be unique within the subset specified, not the entire database table.
(Inherited from DatabaseObjects.)
Protected method ObjectByKeyIfExists
Returns an object using a unique key value. The key must be unique within this collection. If the collection's DatabaseObjects.Subset has been implemented then the key need only be unique within the subset specified, not the entire database table. Returns Nothing/null if the object does exist with the specified key. This feature is what differentiates DatabaseObjects.ObjectByKey() from DatabaseObjects.ObjectByKeyExists().
(Inherited from DatabaseObjects.)
Protected method ObjectByOrdinalFirst
ObjectByOrdinalFirst returns the first object in the collection respectively filtered and sorted by the collection's Subset and OrderBy values. It differs from ObjectByOrdinal in that it only loads the first record from the database table not the entire table.
(Inherited from DatabaseObjects.)
Protected method ObjectByOrdinalLast
Returns the last object in the collection respectively filtered and sorted by the collection's Subset and OrderBy values. It differs from ObjectByOrdinal in that it only loads the first record from the database table not the entire table.
(Inherited from DatabaseObjects.)
Protected method ObjectDelete
Deletes an object's database record. If this collection's Subset has been implemented then the object must exist within the subset, otherwise the object will not be deleted. If the object has not been saved to the database the function will exit without executing an SQL DELETE command. After deleting the database record the object is set to Nothing. The calling function should receive the object ByRef for this to have any affect. Setting the object to Nothing minimises the possibility of the deleted object being used in code after ObjectDelete has been called.
(Inherited from DatabaseObjects.)
Protected method ObjectExists
Returns whether the key exists within the collection. If this collection's Subset has been set then only the subset is searched not the entire table.
(Inherited from DatabaseObjects.)
Protected method ObjectExistsByDistinctValue
Returns whether an object exists for the specified distinct value in the collection.
(Inherited from DatabaseObjects.)
Protected method ObjectFieldValues
Returns the database fields for an object from the collection using a distinct value (see IDatabaseObjects.DistinctFieldName). If the collection has implemented the IDatabaseObjects.Subset function then the objDistinctValue need only be unique within the collection's subset, not the entire database table. This is typically used to interogate the database fields before loading the object with a call to ObjectFromFieldValues. This function is rarely used and generally the Object function suffices.
(Inherited from DatabaseObjects.)
Protected method ObjectFromDataReader
Loads an object from the current record of an IDataReader object.
(Inherited from DatabaseObjects.)
Protected method ObjectFromFieldValues
Loads an object from the values contained in an SQLFieldValues object. This function is generally used from within an DatabaseObject.Load function when the TableJoins function has been implemented.
(Inherited from DatabaseObjects.)
Protected method ObjectIfExists
Returns an instance of an object from this collection using a distinct value as specified by DistinctFieldName. If Subset has been implemented then the objDistinctValue need only be unique within the subset specified, not the entire database table. Returns Nothing/null if the distinct value does not exist in the database. This feature is what differentiates DatabaseObjects.Object() from DatabaseObjects.ObjectIfExists().
(Inherited from DatabaseObjects.)
Protected method ObjectsArray
Returns an array of IDatabaseObject objects contained within this collection.
(Inherited from DatabaseObjects.)
Protected method ObjectSave
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.
(Inherited from DatabaseObjects.)
Protected method ObjectsCount
Returns the number of items in this collection. If this collection's Subset has been implemented then this function returns the number of records within the subset, not the entire table. Also utilises the table joins so that any filters specified on the subset can be used.
(Inherited from DatabaseObjects.)
Protected method ObjectsDeleteAll
Deletes all of the objects in this collection. If Subset has been implemented then only the objects within the subset are deleted, not the table's entire contents.
(Inherited from DatabaseObjects.)
Protected method ObjectsDictionary
Returns an IDictionary object. Each key/value pair contains a key and the object associated with the key.
(Inherited from DatabaseObjects.)
Protected method ObjectsDictionaryByDistinctValue
Returns an IDictionary object. Each key/value pair contains a distinct value and the object associated with the distinct value.
(Inherited from DatabaseObjects.)
Protected method ObjectsList
Returns an IList object containing all of this collection's objects. This function is useful when loading a set of objects for a subset or for use with the IEnumerable interface.
(Inherited from DatabaseObjects.)
Protected method ObjectsSearch
Returns a collection of objects that match the specified search criteria. This function utilises any subsets, ordering or table joins specified in this collection. To add a set of conditions to the objSearchCriteria object with higher precendance use the "Add(SQLConditions)" overloaded as this will wrap the conditions within parentheses.
(Inherited from DatabaseObjects.)
Protected method OrderBy
Should return an SQLSelectOrderByFields object containing the list of fields the collection will be sorted by. Just as with an SQL statement, the order of the fields added to the collection indicates the group sorting. If DatabaseObjects.TableJoins has been implemented then fields from the adjoining table or tables can be utilized. The sort order is used by the ObjectByOrdinal, ObjectByOrdinalFirst and ObjectsSearch functions. Should return Nothing if no ordering is required. Implementing this function is optional.
(Inherited from DatabaseObjects.)
Protected method RootContainer<(Of <<'(TRootContainer>)>>)
Returns the root container object that this object is a child of.
(Inherited from DatabaseObjects.)
Protected method Subset
Should return the conditions that define the collection's subset. If the collection should include the entire table then this function should return Nothing. Implementing this function is optional.
(Inherited from DatabaseObjects.)
Protected method TableJoins
Should return an SQLSelectTableJoins object containing the table or tables to be joined to the primary table. This function is useful in optimising database loading speeds by allowing multiple tables to be joined into one data set. The resultant data set can then be used to load objects from the associated tables avoiding subsequent SQL calls. For a complete example, see the demonstration program. Should return Nothing if no table joins are required. Implementing this function is optional.
(Inherited from DatabaseObjects.)
Protected method TableName
Should return the name of the table associated with this collection. This function should almost always be implemented.
(Inherited from DatabaseObjects.)
Public method ToString
Returns a String that represents the current Object.
(Inherited from Object.)
Protected method VolatileItemsLoad
Loads the items for this collection. This is usually overridden in base class so that code can be executed before the objects list is loaded. Because otherwise code cannot be executed before the MyBase.New or :base() call to this base class. as the items are loaded as part of the constructor.
(Inherited from DatabaseObjectsVolatile.)
Protected method VolatileObjectAdd()()()()
Adds a new object (created via ItemInstance) to the in-memory list, and flags the item to be saved to the database when VolatileObjectsSave() is called. Returns the new object that has been added to the in-memory list.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected method VolatileObjectAdd(T)
Adds an item to the in-memory list, and flags the item to be saved to the database when VolatileObjectsSave() is called.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected method VolatileObjectAdd(IDatabaseObject)
Adds an item to the in-memory list, and flags the item to be saved to the database when VolatileObjectsSave() is called.
(Inherited from DatabaseObjectsVolatile.)
Protected method VolatileObjectDelete(T)
Removes the item from the in-memory list, and flags the item to be deleted when VolatileObjectsSave() is called.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected method VolatileObjectDelete(IDatabaseObject)
Removes the item from the in-memory list, and flags the item to be deleted when VolatileObjectsSave() is called.
(Inherited from DatabaseObjectsVolatile.)
Protected method VolatileObjectIndexOf(T)
Returns the index at which the object exists in the in-memory list.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected method VolatileObjectIndexOf(IDatabaseObject)
Returns the index at which the object exists in the in-memory list.
(Inherited from DatabaseObjectsVolatile.)
Protected method VolatileObjectsClear
Clears all items in the in-memory list. Items are NOT flagged for deletion and subsequently deleted in VolatileObjectsSave(). Use VolatileObjectsDeleteAll to for this purpose.
(Inherited from DatabaseObjectsVolatile.)
Protected method VolatileObjectsDeleteAll
Removes all items from the in-memory list, and flags them to be deleted on the next VolatileObjectsSave(). To clear the list without deleting the objects use VolatileObjectsClear().
(Inherited from DatabaseObjectsVolatile.)
Protected method VolatileObjectsEnumerator
Returns the enumerator for all objects currently in the in-memory list.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected method VolatileObjectsSave
All items flagged for deletion (via VolatileObjectDelete()) are deleted in the database. Then all items that have been added to the in-memory list (via VolatileObjectAdd()) are added/saved to the database. If any of the objects implement IDatabaseObjectVolatile then the IDatabaseObjectVolatile.Save function is called instead of the default Database.ObjectSave() call. This allows the object to perform any additional checking and validation. IDatabaseObjectVolatile.Save is assumed to save itself to the database. i.e. via a call to MyBase.Save(). Objects that do not implement IDatabaseObjectVolatile are still saved via the Database.ObjectSave() function.
(Inherited from DatabaseObjectsVolatile.)

Properties

  Name Description
Public property Count
Returns the number of items in the in-memory list.
Protected property Data
Returns the argument passed into the constructor New(Database, Object).
(Inherited from DatabaseObjectsVolatile.)
Public property Item
Returns an item from the in-memory list at a specific ordinal index.
Protected property Parent
Returns the parent object that this collection is associated with. This property will return Nothing if the 'New(DatabaseObjects.Database)' constructor is used.
(Inherited from DatabaseObjects.)
Protected property ParentDatabase
Returns the database associated with this collection/database table.
(Inherited from DatabaseObjects.)
Protected property ParentDistinctValue
Returns the distinct value of the parent i.e. Parent.DistinctValue Throws a NullReferenceException if there is no parent.
(Inherited from DatabaseObjects.)
Protected property VolatileObjectByOrdinal
Returns an item at the specific index in the in-memory list.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected property VolatileObjects
Returns all items that have been added or were part of the initial list of objects. If there are no items in the list then a zero length array is returned. This list does not include any objects that have been deleted via VolatileObjectDelete(). After VolatileObjectsSave() has been called this list remains the same.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)
Protected property VolatileObjectsCount
Returns the number of items in the in-memory list.
(Inherited from DatabaseObjectsVolatile.)
Protected property VolatileObjectsToDelete
Returns all objects that have been flagged for deletion via VolatileObjectDelete(). After VolatileObjectsSave() has been called this list is cleared and a zero length array would be returned.
(Inherited from DatabaseObjectsVolatile<(Of <(<'T>)>)>.)

See Also