DATACOUCH-166 - Add basic SpEL support

Added the step of parsing SpEL expressions delimited by ${ } in StringN1qlBasedQuery, then the actual evaluation of each expression.

Refactored StringN1qlBasedQuery to use SpEL across the board, including for N1QL specific placeholders (SELECT-FROM, WHERE filter, etc...).

Refactored StringN1qlBasedQuery to use local methods rather than static methods, and amended the unit tests accordingly (using mocks).

Refactored getStatement and getCountStatement so they can see the parameters passed in at runtime.

Added unit tests + integration test.

Added SpEL support example in documentation.
This commit is contained in:
Simon Baslé
2015-10-16 16:51:31 +02:00
parent 6294b03f46
commit ec129e86a8
10 changed files with 324 additions and 91 deletions

View File

@@ -15,6 +15,10 @@
<appender-ref ref="console" />
</root>
<!-- You can use these logger configurations to log more details:
- log the Couchbase queries produced by the framework
- log details of the parsing of SpEL in N1QL inline queries-->
<logger name="org.springframework.data.couchbase.repository.query" level="debug"/>
<logger name="org.springframework.data.couchbase.repository.query.StringN1qlBasedQuery" level="trace"/>
</configuration>