-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for persisting key properties on JSON-mapped entity types #28594
Comments
This was referenced Aug 4, 2022
sending for retriage since our plans for json + value types |
Some notes on this based on our recent design discussion in Redmond: Advantages
Issues
@AndriySvyryd @ajcvickers let me know if I've missed something. |
ajcvickers
added a commit
that referenced
this issue
Aug 19, 2024
Fixes #29380 There are several aspects to #29380: - Constructor binding (already fixed) - Round-tripping the `Id` property value (addressed by this PR) - Persisting key values in JSON collection documents (tracked by #28594) I investigated persisting key values, but identity lookup requires key values in the materializer before we do the parsing of the document. This means persisted key values are not available without re-writing this part of the shaper, which we can't do for 9. To fix the main issue (round-trip `Id`) this PR changes the way identity on owned JSON collection documents works. Instead of discovering and using the `Id` property, we treat it like any other property. We then create a shadow `__synthesizedOrdinal` property to act as the ordinal part of the key. We need to discuss: - Is this breaking for any scenario that was working before? - Does this put us in a bad place for the future of owned types with explicit keys?
ajcvickers
added a commit
that referenced
this issue
Aug 20, 2024
Fixes #29380 There are several aspects to #29380: - Constructor binding (already fixed) - Round-tripping the `Id` property value (addressed by this PR) - Persisting key values in JSON collection documents (tracked by #28594) I investigated persisting key values, but identity lookup requires key values in the materializer before we do the parsing of the document. This means persisted key values are not available without re-writing this part of the shaper, which we can't do for 9. To fix the main issue (round-trip `Id`) this PR changes the way identity on owned JSON collection documents works. Instead of discovering and using the `Id` property, we treat it like any other property. We then create a shadow `__synthesizedOrdinal` property to act as the ordinal part of the key. We need to discuss: - Is this breaking for any scenario that was working before? - Does this put us in a bad place for the future of owned types with explicit keys?
ajcvickers
added a commit
that referenced
this issue
Aug 20, 2024
* Persist `Id` values into owned collection JSON documents Fixes #29380 There are several aspects to #29380: - Constructor binding (already fixed) - Round-tripping the `Id` property value (addressed by this PR) - Persisting key values in JSON collection documents (tracked by #28594) I investigated persisting key values, but identity lookup requires key values in the materializer before we do the parsing of the document. This means persisted key values are not available without re-writing this part of the shaper, which we can't do for 9. To fix the main issue (round-trip `Id`) this PR changes the way identity on owned JSON collection documents works. Instead of discovering and using the `Id` property, we treat it like any other property. We then create a shadow `__synthesizedOrdinal` property to act as the ordinal part of the key. We need to discuss: - Is this breaking for any scenario that was working before? - Does this put us in a bad place for the future of owned types with explicit keys? * Added validation of no explicit keys
ajcvickers
added a commit
that referenced
this issue
Aug 20, 2024
* Persist `Id` values into owned collection JSON documents Fixes #29380 There are several aspects to #29380: - Constructor binding (already fixed) - Round-tripping the `Id` property value (addressed by this PR) - Persisting key values in JSON collection documents (tracked by #28594) I investigated persisting key values, but identity lookup requires key values in the materializer before we do the parsing of the document. This means persisted key values are not available without re-writing this part of the shaper, which we can't do for 9. To fix the main issue (round-trip `Id`) this PR changes the way identity on owned JSON collection documents works. Instead of discovering and using the `Id` property, we treat it like any other property. We then create a shadow `__synthesizedOrdinal` property to act as the ordinal part of the key. We need to discuss: - Is this breaking for any scenario that was working before? - Does this put us in a bad place for the future of owned types with explicit keys? * Added validation of no explicit keys
ajcvickers
added a commit
that referenced
this issue
Aug 21, 2024
* Persist `Id` values into owned collection JSON documents Fixes #29380 There are several aspects to #29380: - Constructor binding (already fixed) - Round-tripping the `Id` property value (addressed by this PR) - Persisting key values in JSON collection documents (tracked by #28594) I investigated persisting key values, but identity lookup requires key values in the materializer before we do the parsing of the document. This means persisted key values are not available without re-writing this part of the shaper, which we can't do for 9. To fix the main issue (round-trip `Id`) this PR changes the way identity on owned JSON collection documents works. Instead of discovering and using the `Id` property, we treat it like any other property. We then create a shadow `__synthesizedOrdinal` property to act as the ordinal part of the key. We need to discuss: - Is this breaking for any scenario that was working before? - Does this put us in a bad place for the future of owned types with explicit keys? * Added validation of no explicit keys
ajcvickers
added a commit
that referenced
this issue
Aug 21, 2024
* Persist `Id` values into owned collection JSON documents Fixes #29380 There are several aspects to #29380: - Constructor binding (already fixed) - Round-tripping the `Id` property value (addressed by this PR) - Persisting key values in JSON collection documents (tracked by #28594) I investigated persisting key values, but identity lookup requires key values in the materializer before we do the parsing of the document. This means persisted key values are not available without re-writing this part of the shaper, which we can't do for 9. To fix the main issue (round-trip `Id`) this PR changes the way identity on owned JSON collection documents works. Instead of discovering and using the `Id` property, we treat it like any other property. We then create a shadow `__synthesizedOrdinal` property to act as the ordinal part of the key. We need to discuss: - Is this breaking for any scenario that was working before? - Does this put us in a bad place for the future of owned types with explicit keys? * Added validation of no explicit keys
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And make the ordinal property more flexible (e.g. different position in the key or no ordinal at all (the client side collection would need to be a List to preserve the order))
The text was updated successfully, but these errors were encountered: