Breeze / breeze-client

Breeze for JavaScript clients
MIT License
38 stars 16 forks source link

Non pk relations #52

Closed steveschmitt closed 3 years ago

steveschmitt commented 3 years ago

Handle parent-child relations between entities where the child FK relates to a parent property that is not the parent's PK.

Tests for this are in the breeze.js repo, in entityTests.js.

This pull request changes the setDpValueSimple() and setNpValue() functions of DefaultPropertyInterceptor, to update relations when setting properties, and the _linkRelatedEntities() function of EntityManager, to update relations when attaching entities.

This pull request also changes calls to findEntityByKey() to getEntityByKey() because the former is deprecated.