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

Execute , StrType , SyntaxHelp , TryCheckForExistenceOfKey


Enables 'jumping' or 'travelling' from a collection of one entity type to another (related) entity type.

Enables queries like
'Order/WHERE Amount > 10000 EUR/REL Customer/REL SupportTicket'
which will show support tickets for all customer who at some time have ordered something for at least 10 000 EUR.

Corresponds (very) coarsely to the JOIN concept in SQL

There are two ways for this to happen:

1) ToMany:
If IPRelationsKeysPointingTo has a link for the current entity type, like 'Customer' having a link to 'Order' then a jump from a collection of Customers can be made to for instance an Order collection by iterating through all Orders with CustomerId present in the collection of Customers.

2) ToOne:
A jump from a collection of 'OrderLine' to 'Order', or 'Order' to 'Customer' can be made by iterating through the whole collection looking for respectively 'OrderId = xxx' and 'CustomerId = xxx' properties.

Variant 1) (ToMany) will be the default attempted. If relevant relations for 1) is not found, then variant 2) (ToOne) will be attempted.

Does also work with PKRelAttribute (ForeignEntity).

NOTE: The relevant keys for 'jumping' must exist. If you for instance do like this
NOTE: (admittedly meaningless query, but it explains the point though):
NOTE: 'Order/WHERE Amount > 10000 EUR/SELECT Amount, Created/REL Customer'
NOTE: then the key CustomerId is not available, and the jumping breaks down.
NOTE: 'Order/WHERE Amount > 10000 EUR/SELECT CustomerId, Amount, Created/REL Customer'
NOTE: on the other hand would work (but use of SELECT is meaningless anyway of course).

See SyntaxHelp.


ExecuteTransforms the given input collection into a resulting collection.
StrTypeIn the simplest terms, the ToStringVeryShort representation of the type that we are 'jumping' to.
SyntaxHelp'REL {type}'
TryCheckForExistenceOfKeyUsed by query expressions in order to catch wrong field names used or misspelling of field names.

Details

Generated 2024-04-19 13:21:29.258 UTC