Query Follow Relation Recursively
Fetches the objects that are related to the current list of objects
Description
This is a specialized case of Query Follow Relation for cases where a data type has a relation to itself. In such a case the relations are followed recursively until the last objects are retrieved.
Example
If we have a Folder data type, with a contains relation to other Folders, we could have 4 Folder instances related as follows:
rootFolder -> subFolder1 -> subSubFolder
|-> subFolder2
then using Query Follow Relation only returns subFolder1 and subFolder2. Query Follow Relation Recursively will however return the lowest level objects subSubFolder and subFolder2.
If add to result is true, then the function returns [subFolder1, subSubFolder] and subFolder2.
Inputs
- query (Query): The query to which the relation must be added
- relation (Relation): The relation to follow
- add to result (Boolean): See main description
- to origin (Boolean): Follows the relation in reverse
Outputs
- query (Query)