문제

Given the following 1 to Many data structure:

Personnel <- Phones

And I pulled Personnel first, and on a separate call I retrieve Phone.

So now there're 2 references to the same Phone, one that's under Personnel and another that's a stand alone. Are they copies or references? Does the manager know to resolve this?

If it does, what kind of convention does it need to reconcile the 2 entities in the cache?

도움이 되었습니까?

해결책

Within an EntityManager, Breeze caches all entities by their keys, so you will never have duplicates of the same entity. Breeze also fixes up any references for children or parents that are queried independently ( this depends on having correct metadata about the foreign key property of the dependent objects), so regardless of how you queried the phones there will only ever be one instance of each phone and that instance will be automatically hooked up to its parent 'Personnel' entity.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top