tree-ware / tree-ware-kotlin-core

Apache License 2.0
1 stars 0 forks source link

Association meta-model should specify only target entity type #60

Closed deepak-nulu closed 2 years ago

deepak-nulu commented 3 years ago

Currently, an association meta-model needs to specify a (single) path to the target entity, and a corresponding association model needs to specify the keys along the path.

This makes it hard to support use-cases wherein the path has recursive compositions. For example, a site entity that contains a sub_sites field that composes itself (the site entity). With such a definition, a site can be a top-level site with a path like /root_entity/site, or it can be a nested site, with a path like /root_entity/site/sub_site*. So 2 paths need to be supported by an association that points to a site. More paths need to be supported if there are more recursive compositions in the path.

In order to support the above use-case as well as other use-cases where a target entity has entirely different paths in the model tree, paths should be dropped from the association meta-model. The association meta-model should instead specify only the target entity (site in the above example). The corresponding association model should specify the entire path (instead of just specifying the keys along the path).