Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top