Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow manual disabling for One side cross-repository link #20

Open
artem-v-shamsutdinov opened this issue Dec 27, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@artem-v-shamsutdinov
Copy link
Member

By default the relation edges (many-to-many links) will be present in the repository containing the One side of a relationship. There may be cases where the developer intends to allow only one-directional repository navigation (from the Many side).

Provide a way to remove a link to one of repositories (or links to all or many of repositories) on the Many side. This can be done by creating a property on the edge table that will signify if a given relationship should be present in the One side repository or not.

Maintenance of this relationship may be done via a utility function like:

unlinkRepositories(oneSideEntity, oneSideEntity.crossRepositoryOneToMany)
unlinkRepositories(oneSideEntity, oneSideEntity.crossRepositoryOneToMany, oneSideEntity.crossRepositoryOneToMany[2])
unlinkRepositories(oneSideEntity, oneSideEntity.crossRepositoryOneToMany, oneSideEntity.crossRepositoryOneToMany.slice(2, 4))

an inverse function can also be provided:

linkRepositories(oneSideEntity, oneSideEntity.crossRepositoryOneToMany)
linkRepositories(oneSideEntity, oneSideEntity.crossRepositoryOneToMany, oneSideEntity.crossRepositoryOneToMany[2])
linkRepositories(oneSideEntity, oneSideEntity.crossRepositoryOneToMany, oneSideEntity.crossRepositoryOneToMany.slice(2, 4))

This will flip a flag on the edge record for each of the OneToMany child records specified. The in memory value of this can be kept in entityState property (which may have to be expanded from being a plain enum to a record)

@artem-v-shamsutdinov artem-v-shamsutdinov added the enhancement New feature or request label Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant