breeze.js | Breeze for JavaScript clients | REST library
kandi X-RAY | breeze.js Summary
kandi X-RAY | breeze.js Summary
Breeze for JavaScript clients
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of breeze.js
breeze.js Key Features
breeze.js Examples and Code Snippets
Community Discussions
Trending Discussions on breeze.js
QUESTION
I have noticed an irksome discrepancy in Breeze.js between deleting a not yet persisted entity (EntityState = "Added") and a persisted entity with respect to any references to it (foreign keys).
This may be an issue related to generating temporary keys for new entities. In this case, we generate negative numbers for temporary keys (ids), replaced with the actual keys when they are persisted.
This will be more easily explained with a concrete example. Say we have an entity called Person that holds a reference to a Title entity ("Mr", "Mrs", etc):
...ANSWER
Answered 2018-Feb-02 at 13:21When it comes to deletes, Breeze makes an important distinction between
- (case a) entities that exist only on the client (those in the Added state), and
- (case b) entities that have been persisted on the server.
For an already-persisted entity (case b), Breeze must keep track of that deleted entity, and send the deletion to the server. Any foreign keys on the server must be updated to remove references to the deleted entity, so breeze updates the related client entities accordingly and sends those changes to the server as well.
For a newly-created entity (case a), the server knows nothing about it. When it is
"deleted" on the client, Breeze doesn't actually set it Deleted
, because it doesn't
need to send a deletion to the server. Instead, it sets it Detached
.
When an entity is set Detached
, its navigation properties are set to null, and it
is removed from the EntityManager's cache. Its foreign key properties are not changed,
however, so if you detach an entity and re-attach it, the navigation properties will
be reconnected. This is true whether the entity was Added
or any other state before
it became Detached
.
More about the entity states can be found in the Breeze documentation
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install breeze.js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page