[ROOT] / doc / toc / ARCQuery / Class / ForeignKey

AggregateKeys , AllForeignKeysForEntityType , ForeignField , FunctionKeys , IPRelationsKeysPointingFrom , IPRelationsKeysPointingTo , QuantileKey , Steps , StepsAreOnlyDirectionToOne , ToString , TryGetP , TryGetPInternal

Can find related values, through compound field names.

Like for 'Order', it can find 'Customer.FirstName' (assuming 'Order' contains 'CustomerId').
Can relate several steps like for 'OrderLine', 'Order.Customer.FirstName'.
See ToOne.

Can also traverse 'the other' way (ToMany), like for 'Customer', 'Order.OrderLine.Sum.Sum()' (assuming 'Order' contains 'CustomerId' and 'OrderLine' contains 'OrderId').

Note that in a series of mixed traversal (that is containing both ToMany and ToOne) each ToOne traversal will be limited to distinct primary keys.
For instance (from the ARNorthwind example database), for query 'Territory/SELECT EmployeeTerritory.Employee.Order.OrderLine.Sum()' only unique 'EmployeeId' will be used before looking up 'Order'.
(this does not necessarily make the query above meaningful though).

Foreign key can be used in combination with EntityMethodKey, NewKey and FunctionKey.
For instance like 'Order/SELECT ShippedDate, Sum, Customer.Name' were 'Customer.Name' is an EntityMethodKey combining FirstName, LastName and CompanyName).

This is an not an expandable concept (class is sealed).
In other words, this class contains all the relevant functionality and you are not expected to implement anything specific in your ApplicationSpecificCode.

Note: In queries like
"Order/SELECT CustomerId, Created, Amount/WHERE Customer.FirstName = 'John'"
the foreign-key 'CustomerId' should be included as shown in here (see QueryExpressionSelect).
If you only do
"Order/SELECT Created, Amount/WHERE Customer.FirstName = 'John'"
then the link to Customer is not available.
(For the example given above it would of course have been more natural to just write:
"Order/WHERE Customer.FirstName = 'John'/SELECT Created, Amount"
See also MemberEntityKey.

AggregateKeysAggregations to be used on the multiple foreign entity values that are found when one of the Steps are ToMany.
AllForeignKeysForEntityTypeReturns all possible foreign keys relevant for the given entity type, like for Order: 'Customer.FirstName' and 'Customer.LastName'.
ForeignFieldThe actual field in the final foreign entity to return value for.
FunctionKeysAll FunctionKeys chained at end of compound key (but before an eventual QuantileKey).
IPRelationsKeysPointingFromContains, for each (entity type) key, a list of entity types which that entity type points to.
IPRelationsKeysPointingToContains, for each (entity type) key, a list of entity types with foreign keys pointing to that entity type.
QuantileKeyEventual final QuantileKey at end of compound key.
StepsThe actual -ForeignKeySingleStep- leading to the ForeignField.
StepsAreOnlyDirectionToOneIf TRUE then -TryGetPInternal) will use much simpler code without collections and parallell executions.
ToStringThe ToString representation is the one relevant when used as key, like in IK or when selecting like 'SELECT {fieldName}'.
TryGetPThe outwards facing executor, understanding use of FunctionKeys.
TryGetPInternalThe internal executor, containing the specific functionality for how to evaluate the key.


Generated 2022-06-28 05:15:39.043 UTC