The DatabaseObjectsUsingAttributes type exposes the following members.
Constructors
Name | Description | |
---|---|---|
DatabaseObjectsUsingAttributes(Database) |
Initializes a new DatabaseObjects with it's associated database.
|
|
DatabaseObjectsUsingAttributes(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.
|
|
DatabaseObjectsUsingAttributes(RootContainer) |
Initializes with it the associated root container and database.
|
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.) |
Properties
Name | Description | |
---|---|---|
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.) |