You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add n1ql.scope and n1ql.collection spel expressions for @query.
This adds n1ql.scope and n1ql.collection spel expressions for
@query so that n1ql.bucket doesn't need to be overloaded with
the collection name. This will make the bucket name available
in n1q.bucket.
This is a breaking change as queries that used n1ql.bucket to
get the collection name (especially in the case of pre-scope-
and-collection @queries that (a) referenced n1ql.bucket instead
of referencing other spel expressions that include the
bucket/collection name; and (b) still worked after the
repository was moved from a bucket onto a collection by
virtue of n1ql.bucket having the value of the collection in
such instances.
Closes#1445.
Copy file name to clipboardExpand all lines: src/main/asciidoc/repository.adoc
+3-1
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,8 @@ A few N1QL-specific values are provided through SpEL:
133
133
- `#n1ql.selectEntity` allows to easily make sure the statement will select all the fields necessary to build the full entity (including document ID and CAS value).
134
134
- `#n1ql.filter` in the WHERE clause adds a criteria matching the entity type with the field that Spring Data uses to store type information.
135
135
- `#n1ql.bucket` will be replaced by the name of the bucket the entity is stored in, escaped in backticks.
136
+
- `#n1ql.scope` will be replaced by the name of the scope the entity is stored in, escaped in backticks.
137
+
- `#n1ql.collection` will be replaced by the name of the collection the entity is stored in, escaped in backticks.
136
138
- `#n1ql.fields` will be replaced by the list of fields (eg. for a SELECT clause) necessary to reconstruct the entity.
137
139
- `#n1ql.delete` will be replaced by the `delete from` statement.
138
140
- `#n1ql.returning` will be replaced by returning clause needed for reconstructing entity.
@@ -164,7 +166,7 @@ This is *NOT* intended for projections to DTOs.
164
166
Another example: +
165
167
`#{#n1ql.selectEntity} WHERE #{#n1ql.filter} AND test = $1` +
166
168
is equivalent to +
167
-
`SELECT #{#n1ql.fields} FROM #{#n1ql.bucket} WHERE #{#n1ql.filter} AND test = $1`
169
+
`SELECT #{#n1ql.fields} FROM #{#n1ql.collection} WHERE #{#n1ql.filter} AND test = $1`
168
170
169
171
.A practical application of SpEL with Spring Security
0 commit comments