| Done (implementation, tests, documentation). All tests, including new ones, pass. Pull request created on Github. Additional notes on the implementation:
- In addition to originally announced, I have added even two more types of queries. Altogether the implementation now adds findOne, findAndModify, insert, remove, update to the list of supported native query types, all supported using CLI syntax.
- As indicated by comment-74968, I have added a new method called executeBackendUpdateQuery to QueryableGridDialect, which is currently implemented only by MongoDBDialect. All other implementations throw a UOE.
- Regarding, update queries, the implementation current does simply return -1 if the update was not acknowledged by the underlying Mongo node. It might be better or even needed to throw an exception instead. This is currently not done because I simply don't know which one should be thrown then. Anyway, it can be changed easily.
- I have added defensive checks whether there are named or positional parameters in a query to executeBackendQuery and executeBackendUpdateQuery. I'm not sure whether this is the right place to do such things, and whether it should be done at all. If you think this is not appropriate there then simply remove them, or add a note.
- Finally, I have resolved some (minor) issues along the way:
- MongoDBDialect make all methods static that can be static.
- NativeQueryParser two minor bugs (typos) fixed.
Aside, I have two more wishes:
- If there are no further issues with my implementation, would you please rollout a new Beta version soon. I'm currently hacking in my branch into another project manually, but it would be much more convenient to upgrade dependencies to the new version.
- The implementation could take advantage of upgrading the MongoDB Java driver to the latest release 3.2.x. This would make it possible to better support findAndModify and remove queries.
|