The DatabaseObjectsListKeyedUsingAttributes<(Of <(<'T, TKey>)>)> type exposes the following members.
Constructors
Name | Description | |
---|---|---|
DatabaseObjectsListKeyedUsingAttributes<(Of <(<'T, TKey>)>)>(Database) |
Initializes a new DatabaseObjects with it's associated database.
|
|
DatabaseObjectsListKeyedUsingAttributes<(Of <(<'T, TKey>)>)>(DatabaseObject) |
Initializes a new DatabaseObjects with it's associated parent object.
The Parent property can be used to access the parent variable passed into this constructor.
|
|
DatabaseObjectsListKeyedUsingAttributes<(Of <(<'T, TKey>)>)>(RootContainer) |
Initializes with it the associated root container and database.
|
Methods
Name | Description | |
---|---|---|
Add |
Creates and returns a new object associated with this collection.
(Inherited from DatabaseObjectsList<(Of <(<'T>)>)>.) |
|
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.) | |
Exists |
Returns whether the key exists within the collection.
(Inherited from DatabaseObjectsListKeyed<(Of <(<'T, TKey>)>)>.) |
|
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.) |
|
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.
If this function is not overriden an object of type T will be created.
The type T must have a default constructor or a constructor that accepts a type of
DatabaseObjects.Generic.DatabaseObjects or a subclass.
(Inherited from DatabaseObjects<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
ObjectDelete(T%) |
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<(Of <(<'T>)>)>.) |
|
ObjectDelete(IDatabaseObject%) |
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<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
ObjectsArray |
Returns an array of objects contained within this collection.
(Inherited from DatabaseObjects<(Of <(<'T>)>)>.) |
|
ObjectSave(T) |
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<(Of <(<'T>)>)>.) |
|
ObjectSave(IDatabaseObject) |
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 Generic.Dictionary object. Each key/value pair contains a key and
the object associated with the key.
(Inherited from DatabaseObjects<(Of <(<'T>)>)>.) |
|
ObjectsDictionaryByDistinctValue |
Returns a Generic.Dictionary object. Each key/value pair contains a distinct
value and the object associated with the distinct value.
(Inherited from DatabaseObjects<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
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<(Of <(<'T>)>)>.) |
|
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.) |
Properties
Name | Description | |
---|---|---|
Count |
Returns the number of items in this collection.
(Inherited from DatabaseObjectsList<(Of <(<'T>)>)>.) |
|
Item |
Returns an object for a key value.
(Inherited from DatabaseObjectsListKeyed<(Of <(<'T, TKey>)>)>.) |
|
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.) |