You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Object Orientation, relationships are generally managed as references from itself and not stored as standalone entities.
a -[contradicts]-> b
instead of
a -[contradicts]- b
Currently, to access an entity and its associated relations extra calls must be made to the server and database and/or extra parameters must be provided to obtain the desired entities
Example problem:
To obtain a list of SystemComponent an organizationSlug and solutionSlug must be provided.
The parent components are not included in this call though because the belongs relationship between parent and child are available until a subsequent call is made:
A challenge though here is that the default behavior of the ORM is to generate multiple junction tables (one per relation). Currently the database has a single table for relations:
This could be mitigated by providing the explicit pivot entity:
In Object Orientation, relationships are generally managed as references from itself and not stored as standalone entities.
a -[contradicts]-> b
instead of
a -[contradicts]- b
Currently, to access an entity and its associated relations extra calls must be made to the server and database and/or extra parameters must be provided to obtain the desired entities
Example problem:
To obtain a list of
SystemComponent
anorganizationSlug
andsolutionSlug
must be provided.The parent components are not included in this call though because the
belongs
relationship between parent and child are available until a subsequent call is made:#453
This use case can not be resolved generically as things stand now:
Creating more endpoints to support each potential relationship that might exist is non-trivial and a potential maintenance nightmare.
To resolve the issue, the relations should be defined on the
Requirement
entity as@ManyToMany
.ORM reference: https://mikro-orm.io/docs/relationships#manytomany
A challenge though here is that the default behavior of the ORM is to generate multiple junction tables (one per relation). Currently the database has a single table for relations:
This could be mitigated by providing the explicit pivot entity:
The text was updated successfully, but these errors were encountered: