-
Notifications
You must be signed in to change notification settings - Fork 192
DATACOUCH-36 - Don't allow NULL values to be stored. #9
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
Conversation
It is illegal to store a NULL value as a document. An attempt to do so will throw an IllegalArgumentException. -=david=-
DATACOUCH-36 - Don't allow NULL values to be stored.
👍 thanks! |
You're welcome :) |
private void verifyValueType(final Object value) { | ||
if(value == null) { | ||
throw new IllegalArgumentException("Attribute of type null cannot be stored."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that:
{
"field1": {
"field11": 123
},
"field2": null,
"field3": "abc"
}
is valid json. Why the code throws exception in case of null value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I think that came from the fact that you cant store a NULL as a document in couchbase.. We should check somewhere else for that and allow it here probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like another Jira ticket for this or can I create another pull request for the same ticket? Possibly reopen the ticket to document the new changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kdombeck jeah I think - since this one has already been released - we should do a new ticket and a new PR if you don't mind. cheers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kdombeck Any idea why I can't persist null fields (not null documents) using a CrudRepository? I want to save null fields.
Gem installation instructions updated
It is illegal to store a NULL value as a document. An attempt to do so will
throw an IllegalArgumentException.
-=david=-