问题
I want to save a null value to a document with a Spring Data Repository.
So someEntity below is an object with a property set to null in java.
...
repository.save(someEntity);
...
Spring will save this as undefined, meaning the property of the document is not set to null. In our use case, we treat null as a proper value.
How can you solve this without overriding the save() method in the repository?
来源:https://stackoverflow.com/questions/27187749/save-null-value-with-spring-repository-to-mongodb-document