The DatabaseObjectsVolatile type exposes the following members.
Constructors
Name | Description | |
---|---|---|
DatabaseObjectsVolatile(Database) |
Initializes a new instance with it's associated database.
|
|
DatabaseObjectsVolatile(DatabaseObject) |
Initializes a new instance with the parent that it is associated with.
|
|
DatabaseObjectsVolatile(RootContainer) |
Initializes with it the associated root container and database.
|
|
DatabaseObjectsVolatile(Database, Object) |
Initializes a new instance with it's associated database and data that
can be used for specifying a subset.
|
Methods
Name | Description | |
---|---|---|
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.) |
|
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.) |
|
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.) |
|
Equals | (Inherited from Object.) | |
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.) |
|
GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
|
GetType |
Gets the Type of the current instance.
(Inherited from Object.) |
|
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.) |
|
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.) |
|
MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
|
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.) |
|
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.) |
|
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.) |
|
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.) |
|
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.) |
|
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.) |
|
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.) |
|
ObjectExistsByDistinctValue |
Returns whether an object exists for the specified distinct value in the collection.
(Inherited from DatabaseObjects.) |
|
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.) |
|
ObjectFromDataReader |
Loads an object from the current record of an IDataReader object.
(Inherited from DatabaseObjects.) |
|
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.) |
|
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.) |
|
ObjectsArray |
Returns an array of IDatabaseObject objects contained within this collection.
(Inherited from DatabaseObjects.) |
|
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.) |
|
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.) |
|
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.) |
|
ObjectsDictionary |
Returns an IDictionary object. Each key/value pair contains a key and
the object associated with the key.
(Inherited from DatabaseObjects.) |
|
ObjectsDictionaryByDistinctValue |
Returns an IDictionary object. Each key/value pair contains a distinct
value and the object associated with the distinct value.
(Inherited from DatabaseObjects.) |
|
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.) |
|
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.) |
|
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.) |
|
RootContainer<(Of <<'(TRootContainer>)>>) |
Returns the root container object that this object is a child of.
(Inherited from DatabaseObjects.) |
|
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.) |
|
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.) |
|
TableName |
Should return the name of the table associated with this collection.
This function should almost always be implemented.
(Inherited from DatabaseObjects.) |
|
ToString | (Inherited from Object.) | |
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.
|
|
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.
|
|
VolatileObjectAdd(IDatabaseObject) |
Adds an item to the in-memory list, and flags the item to be saved to the database
when VolatileObjectsSave() is called.
|
|
VolatileObjectDelete |
Removes the item from the in-memory list, and flags the item to be deleted when
VolatileObjectsSave() is called.
|
|
VolatileObjectIndexOf |
Returns the index at which the object exists in the in-memory list.
|
|
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.
|
|
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().
|
|
VolatileObjectsEnumerator |
Returns the enumerator for all objects currently in the in-memory list.
|
|
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.
|
Properties
Name | Description | |
---|---|---|
Data |
Returns the argument passed into the constructor New(Database, Object).
|
|
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.) |
|
ParentDatabase |
Returns the database associated with this collection/database table.
(Inherited from DatabaseObjects.) |
|
ParentDistinctValue |
Returns the distinct value of the parent i.e. Parent.DistinctValue
Throws a NullReferenceException if there is no parent.
(Inherited from DatabaseObjects.) |
|
VolatileObjectByOrdinal |
Returns an item at the specific index in the in-memory list.
|
|
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.
|
|
VolatileObjectsCount |
Returns the number of items in the in-memory list.
|
|
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.
|