loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

[LB-Next] Support of Relation (BelongsTo & hasMany) for Repository and ModelDefinition

Open dhmlau opened this issue 9 years ago • 2 comments

Details

Details can be found in #419.

For example, `Customer` and `Order` has the `belongsTo` relation. When customerId was given, 
it becomes the filter for the `Order` repository. It implies that `Order` repository is not a free 
form repository but is constrained by `customerID=xxx`.

When doing CRUD operation, make sure this constrained is honored.
Currently, we are using primary key/foreign key for the relationship. 
In LB Next, we should allow people to use any properties.

This task is only for belongsTo relation.

Acceptance Criteria

  • [ ] Actual implementation on belongsTo and hasMany
  • [ ] Have example in how to use it
  • [ ] have test cases

BLOCKED BY

  • https://github.com/strongloop/loopback-next/issues/537

dhmlau avatar Jun 30 '17 18:06 dhmlau

I've created a new issue #812 and just realised it's duplicated.

ashdns avatar Jan 19 '18 14:01 ashdns

Closing it in favor of https://github.com/strongloop/loopback-next/issues/995

dhmlau avatar Feb 26 '18 17:02 dhmlau