hibernate/hibernate-ogm — pull request #317 by gunnarmorling (2014-05-08 07:23:47+00:00)
Title: OGM-480: PREVIEW Parameters in native Neo4j queries

@Sanne: In lack of all the other OGM reviewers, could you take a look at this change and let me know what you think? This is only about the last three commits ([actual diff](https://github.com/gunnarmorling/hibernate-ogm/compare/gunnarmorling:OGM-480~3...gunnarmorling:OGM-480?expand=1)) from myself (it's based on @DavideD's recent Neo4j work which hasn't been integrated yet).

This adds support for native query parameters in the syntax understood by the store, e.g. `{param}` in case of Neo4j; So that's basically option #1 from the ones [we discussed](https://hibernate.atlassian.net/browse/OGM-480?focusedCommentId=60774&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-60774), but with one important difference: it parses the query to identify the existent parameters.

I set out with removing all the logic which deals with parameter validation, but this required many changes and it basically just didn't feel right. So I put another thought into identifying the present parameters and came to think that it isn't that difficult in the end. All in all this fits much better with the existing surrounding framework.

The current solution uses a tool named [ParBoiled](parboiled.org) to parse the parameters of Neo4j queries; I found that very easy to use and it gave me a quick result, but we could use Antlr of course if we object to using this library (personally I don't mind using that simpler tool just in this particular case; it is very convinient to work with and Neo4j depends on it anyways for its own query parser).

Thanks!