EQL: support for recursively defined entities
Description
At the moment recursively defined composite keys (i.e. there is a member of the same type as the entity itself) is not supported by EQL.
Support for recursive definitions of composite entity keys is now required. It has been identified that implementing the following features should be sufficient to enable such support:
-
[ ] Ability to find by recursively defined key.
-
[ ] Ability to order by recursively defined key.
-
[x] Ability to define fetch models.
Implementation remarks
The implementation could either be based on a predefined maximum depth of the recursive structure, or on a limited support for recursive Common Table Expressions (CTE) that would be used purely for generation of queries that involve recursively defined entities. The CTE approach is preferred and is a proper solution rather than a stop-gap.
If of any help, it can be considered that only one composite key member can be of the same type as the entity itself.
Expected outcome
Support for entity types with recursively defined composite key members.
At this stage it would appear that handling recursively defined entities at the model level provides a better alternative.