Skip to content
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

EntityUpdate.getToMany(String) should return null if the key is not a part of update #638

Closed
andrus opened this issue Jun 28, 2023 · 0 comments
Milestone

Comments

@andrus
Copy link
Contributor

andrus commented Jun 28, 2023

Per recent EntityUpdate refactoring (#636),getToMany(String) returns an empty list if the key is not a part of the update. On the one hand, it follows the convention of not returning null collections, on the other, null and [] in the context of relationship update means 2 different things ("no update" vs "remove all related objects"), so let's change the semantics to return null if there's no update key.

And another aspect... Currently, there is a hack in the parser that sets an array of IDs to a single "null" element to indicate "unset everything". Instead, we should use null and [] as a designators for "toManyIds", and add methods to init empty arrays of related ids|updates when parsing.

andrus added a commit that referenced this issue Jun 29, 2023
… part of update #638

* changing EntityUpdate for the new to-many assumptions
andrus added a commit that referenced this issue Jun 29, 2023
andrus added a commit that referenced this issue Jun 29, 2023
… part of update #638

* moving parser tests to core
* new parser tests
@andrus andrus added this to the 5.0.M18 milestone Jun 29, 2023
@andrus andrus closed this as completed Jun 29, 2023
andrus added a commit that referenced this issue Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant