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

Fixes StringProperty not detecting changes to empty string properly #647

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

mkeckmkeck
Copy link
Contributor

@mkeckmkeck mkeckmkeck commented Mar 5, 2024

  • sirius.db.mixing.properties.StringProperty#setValueToField and sirius.db.mixing.properties.StringProperty#transformValue transform "" be persisted as null
  • this transformation must be considered when checking for null as well

Fixes: SIRI-939

BREAKING NOTE:
This fix changes the behavior of handling null values with Elasticsearch.
Previously, on String fields of Elasticsearch entities the NullAllowed annotation was not required as some checks did not run properly.
Now, these checks are running and it is required to annotate nullable String fields on Elasticsearch entities properly using sirius.db.mixing.annotations.NullAllowed
For JDBC and MongoDB this breakage does not apply.

- sirius.db.mixing.properties.StringProperty#setValueToField and sirius.db.mixing.properties.StringProperty#transformValue
  transform "" be persisted as null
- this transformation must be considered when checking for null as well

Fixes: SIRI-939
@mkeckmkeck mkeckmkeck added the 🐛 Bugfix Contains only a small fix for an existing bug label Mar 5, 2024
- we do want to persists as null
- with previous commit, we properly checked for changes by evaluating
  empty string as null in comparison of changes as well
- now we need to still enable entities to have an empty string as default
  value, thus the default value mechanism must not map those to null

Fixes: SIRI-939
@mkeckmkeck mkeckmkeck merged commit 1b62049 into develop Mar 6, 2024
3 checks passed
@mkeckmkeck mkeckmkeck deleted the feature/mke/SIRI-939_string_property_null branch March 6, 2024 15:31
@mkeckmkeck mkeckmkeck added the 💣 BREAKING CHANGE Contains non-backwards compatible changes to public methods or changes the behavior of existing code label Mar 15, 2024
mkeckmkeck added a commit to scireum/sirius-biz that referenced this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💣 BREAKING CHANGE Contains non-backwards compatible changes to public methods or changes the behavior of existing code 🐛 Bugfix Contains only a small fix for an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants