spring-batch
spring-batch copied to clipboard
Provide accessors in MongoItemWriter to facilitate extensions
Expected Behavior
Provide accessors for collection and delete properties of MongoItemWriter, so that would be easier extending the class
Current Behavior
MongoItemWriter doesn't provide accessors for collection and delete properties
Context
Currently the MongoItemWriter has an extension point in doWrite method. I encountered some difficulties implementing a custom "write or update" logic respecting the original contract, due to the fact that some private properties (collection and delete) don't provide an accessor method.
Hello @vincendep. I'm wondering what exactly is what you need. Do you need a getter for those two fields or would you like to get protected fields for extending the class?.
Hello @vincendep I have added a PR for this issue. @benas any chance that you can take a look at the PR? https://github.com/spring-projects/spring-batch/pull/3975
Hello @santfirax. I don't know what is the best way to go, I just found a bit difficult to extend the MongoItemWriter. I thought about getters only because the one for the MongoTemplate is already provided
Hi, I also have added PR ( #4148 ) for this issue. Similar discussion has been made for templete
property in #1037, and resolved with PR #447 with commit cae2cabdce41ae9a67d4e469fb8b82ff4945a7d9. I did similar changes for this issue.