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

Include related models in DefaultCrudRepository #3446

Closed
5 tasks
bajtos opened this issue Jul 26, 2019 · 0 comments · Fixed by #3583
Closed
5 tasks

Include related models in DefaultCrudRepository #3446

bajtos opened this issue Jul 26, 2019 · 0 comments · Fixed by #3583
Assignees
Labels
feature Relations Model relations (has many, etc.) Repository Issues related to @loopback/repository package

Comments

@bajtos
Copy link
Member

bajtos commented Jul 26, 2019

Modify DefaultCrudRepository to leverage InclusionResolvers to fetch related models in find* methods.

See #3387 for more details & a prototype implementation.

Acceptance criteria

  • Enhance DefaultCrudRepository class: add a new public property inclusionResolvers and a new public method registerInclusionResolver
  • Add a new protected method includeRelatedModels, this method will become an extension point for repository classes extending our default implementation.
  • Modify find, findById and findOne methods to call includeRelatedModels and remove filter.include from the filter argument passed to juggler's PersistedModel APIs (see normalizeFilter in the spike).
  • Under the hood, this new method should call the recently introduced helper includeRelatedModels (see Introduce InclusionResolver concept #3445)
  • Write unit-level tests to verify the implementation, use mocked or stubbed inclusion resolvers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Relations Model relations (has many, etc.) Repository Issues related to @loopback/repository package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants