Description

Database objects are querable (searchable) on the basis of nearly any identifying characteristic. Valid search keys include, but are not limited to: Attribute/Property Value, Object Type, and Category.

Remarks

McDBLib performs queries using a Query by Example model. That is, an McDBQuery object is made to “look” like (or unlike, as desired) the object(s) being sought, then executed. Execution also requires a context, provided by the method to which the McDBQuery is passed as a parameter (e.g. through McDBNode.FindNodes or McDBNodes.FindNodes). Queries executed without a context (i.e. through McDBQuery.Execute) will run on all McDBNode instances in the McDBDatabase instances attached to the McDBQuery. All query executions return an McDBNodes collection, containing McDBNode instance(s) meeting the McDBQuery specification.

Members

Methods
AddSortOrder

A CMcDBQuery object can have the McDBNodes matching its specification returned in sorted order using this method. Sort orders are applied in the order added. That is, the first call to AddSortOrder sets a primary sorting key, and subsequent call(s) specify secondary sorting key(s) (i.e. only used as a “tiebreaker” for equal values of the more primary sorting key(s)).

AttachDatabase

This method allows an open McDBDatabase object to become attached to (i.e. queried by) this McDBQuery, when executed.

AttachToQuery

This method allows this (uninitialized) CMcDBQuery to set its (McDBDatabase) scope from an existing McDBQuery object, allowing simple/more flexible creation of subquery McDBQuery objects.

CloseBracket

End an McDBQuery condition assignment precedence level.

Execute

[Properly formed] McDBQuery instances contain both a specification of the information being sought (i.e. the query) and the database(s) to be searched (i.e. the context). This method allows such a query to execute (i.e without a context object, such as an McDBNode) and returns its result node set.

OpenBracket

Begin an McDBQuery condition assignment precedence level, following ordinary parenthetical precedence rules.

SetAttribute

Assigns an Attribute Value that must be related to one of those in the McDBNode.Attributes of McDBNode instances returned by this McDBQuery.

SetBoolOp

Assigns a relational boolean operation to join the existing and next condition clauses in this McDBQuery.

SetCategory

Assigns a Category (string) that must be related to those in the McDBNode.Categories collection of McDBNode instances returned by this McDBQuery.

SetChild

This method will set a condition for a child node (real or symbolically linked) to be matched for objects in the result set of this query specification. (i.e. the Children property of every node in the McDBNodes result set will contain/not contain the McDBNode in Target as defined by CompOp.

SetCreated

Assigns the Created (date) property of McDBNode instances returned by this McDBQuery.

SetCreator

Assigns the McDBNode.Creator (string) property of McDBNode instances returned by this McDBQuery.

SetDataString

This method will set the string value of the Data property of McDBNodes returned by this McDBQuery. The Data property may be either a string or an object; this method allows query on the value of those objects with Data properties that are stored as strings. It also allows determination of which objects have Data properties stored as strings (versus objects).

SetFlags

This method will set the value of bit positions in the Flags property of McDBNode instances returned by this McDBQuery. Bit flags may be queried as either present or absent, as defined by the arguments.

SetModified

Assigns the last Modified (date) property of McDBNode instances returned by this McDBQuery

SetModifier

Assigns the McDBNode.Modifier (string) property of McDBNode instances returned by this McDBQuery.

SetName

Assigns the Name property of McDBNode instances returned by this McDBQuery.

SetParent

This method will set the primary McDBNode.Parent that will be matched for objects in the results of this query specification.

SetType

Assigns the Object McDBNode.Type (McDBType) property of McDBNode instances returned by this McDBQuery.


Properties
DescriptionRead-write property

A string (unused) description for the query itself.

NameRead-write property

A user defined, but otherwise unused Name for the McDBQuery.

UserDataRead-write property

A variant (unused) for User use, associated with this McDBQuery.