@@ -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 * <prefix>#{<spel>}
@@ -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,20 @@ public int size() {
289289 }
290290
291291 /**
292- * A {@literal Map} from parameter name to SpEL expression.
292+ * Returns whether the query contains Value Expressions.
293+ *
294+ * @return {@literal true} if the query contains Value Expressions.
295+ */
296+ public boolean hasParameterBindings () {
297+ return !expressions .isEmpty ();
298+ }
299+
300+ /**
301+ * A {@literal Map} from parameter name to Value Expression.
293302 *
294303 * @return Guaranteed to be not {@literal null}.
295304 */
296- Map <String , ValueExpression > getParameterMap () {
305+ public Map <String , ValueExpression > getParameterMap () {
297306 return expressions ;
298307 }
299308
@@ -403,7 +412,7 @@ public Map<String, Object> evaluate(Object[] values) {
403412 }
404413
405414 /**
406- * Returns the query string produced by the intermediate SpEL expression collection step.
415+ * Returns the query string produced by the intermediate Value Expression collection step.
407416 *
408417 * @return
409418 */
0 commit comments