Skip to content

Commit b73a31b

Browse files
committed
Expose ParsedQuery parameter name mapping.
1 parent ae2e66f commit b73a31b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/main/java/org/springframework/data/repository/query/ValueExpressionQueryRewriter.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ public class ValueExpressionQueryRewriter {
7272
private final ValueExpressionParser expressionParser;
7373

7474
/**
75-
* A function from the index of a Value expression in a query and the actual SpEL expression to the parameter name to
76-
* be used in place of the SpEL expression. A typical implementation is expected to look like
77-
* <code>(index, spel) -> "__some_placeholder_" + index</code>
75+
* A function from the index of a Value expression in a query and the actual Value Expression to the parameter name to
76+
* be used in place of the Value Expression. A typical implementation is expected to look like
77+
* <code>(index, expression) -> "__some_placeholder_" + index</code>
7878
*/
7979
private final BiFunction<Integer, String, String> parameterNameSource;
8080

8181
/**
82-
* A function from a prefix used to demarcate a SpEL expression in a query and a parameter name as returned from
83-
* {@link #parameterNameSource} to a {@literal String} to be used as a replacement of the SpEL in the query. The
84-
* returned value should normally be interpretable as a bind parameter by the underlying persistence mechanism. A
85-
* typical implementation is expected to look like <code>(prefix, name) -> prefix + name</code> or
82+
* A function from a prefix used to demarcate a Value Expression in a query and a parameter name as returned from
83+
* {@link #parameterNameSource} to a {@literal String} to be used as a replacement of the Value Expressions in the
84+
* query. The returned value should normally be interpretable as a bind parameter by the underlying persistence
85+
* mechanism. A typical implementation is expected to look like <code>(prefix, name) -> prefix + name</code> or
8686
* <code>(prefix, name) -> "{" + name + "}"</code>
8787
*/
8888
private final BiFunction<String, String, String> replacementSource;
@@ -116,9 +116,9 @@ public static ValueExpressionQueryRewriter of(ValueExpressionParser expressionPa
116116
* with prefix being the character ':' or '?'. Parsing honors quoted {@literal String}s enclosed in single or double
117117
* quotation marks.
118118
*
119-
* @param query a query containing SpEL expressions in the format described above. Must not be {@literal null}.
120-
* @return A {@link ParsedQuery} which makes the query with SpEL expressions replaced by bind parameters and a map
121-
* from bind parameter to SpEL expression available. Guaranteed to be not {@literal null}.
119+
* @param query a query containing Value Expressions in the format described above. Must not be {@literal null}.
120+
* @return A {@link ParsedQuery} which makes the query with Value Expressions replaced by bind parameters and a map
121+
* from bind parameter to Value Expression available. Guaranteed to be not {@literal null}.
122122
*/
123123
public ParsedQuery parse(String query) {
124124
return new ParsedQuery(expressionParser, query);
@@ -168,7 +168,7 @@ private EvaluatingValueExpressionQueryRewriter(ValueExpressionParser expressionP
168168
}
169169

170170
/**
171-
* Parses the query for SpEL expressions using the pattern:
171+
* Parses the query for Value Expressions using the pattern:
172172
*
173173
* <pre>
174174
* &lt;prefix&gt;#{&lt;spel&gt;}
@@ -257,7 +257,7 @@ public class ParsedQuery {
257257
}
258258

259259
/**
260-
* The query with all the SpEL expressions replaced with bind parameters.
260+
* The query with all the Value Expressions replaced with bind parameters.
261261
*
262262
* @return Guaranteed to be not {@literal null}.
263263
*/
@@ -289,11 +289,11 @@ public int size() {
289289
}
290290

291291
/**
292-
* A {@literal Map} from parameter name to SpEL expression.
292+
* A {@literal Map} from parameter name to Value Expression.
293293
*
294294
* @return Guaranteed to be not {@literal null}.
295295
*/
296-
Map<String, ValueExpression> getParameterMap() {
296+
public Map<String, ValueExpression> getParameterMap() {
297297
return expressions;
298298
}
299299

@@ -403,7 +403,7 @@ public Map<String, Object> evaluate(Object[] values) {
403403
}
404404

405405
/**
406-
* Returns the query string produced by the intermediate SpEL expression collection step.
406+
* Returns the query string produced by the intermediate Value Expression collection step.
407407
*
408408
* @return
409409
*/

0 commit comments

Comments
 (0)