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
Fix issues when placeholders are appended with other chars eg. '?0xyz' or have been reused multiple times within the query. Additional tests and fixes for complex quoted replacements eg. in regex query. Rely on placeholder quotation indication instead of binding one. Might be misleading when placeholder is used more than once.
Original pull request: #441.
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ExpressionEvaluatingParameterBinder.java
+19-10Lines changed: 19 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@
45
45
/**
46
46
* {@link ExpressionEvaluatingParameterBinder} allows to evaluate, convert and bind parameters to placeholders within a
47
47
* {@link String}.
48
-
*
48
+
*
49
49
* @author Christoph Strobl
50
50
* @author Thomas Darimont
51
51
* @author Oliver Gierke
@@ -59,7 +59,7 @@ class ExpressionEvaluatingParameterBinder {
59
59
60
60
/**
61
61
* Creates new {@link ExpressionEvaluatingParameterBinder}
62
-
*
62
+
*
63
63
* @param expressionParser must not be {@literal null}.
64
64
* @param evaluationContextProvider must not be {@literal null}.
65
65
*/
@@ -76,7 +76,7 @@ public ExpressionEvaluatingParameterBinder(SpelExpressionParser expressionParser
76
76
/**
77
77
* Bind values provided by {@link MongoParameterAccessor} to placeholders in {@literal raw} while considering
78
78
* potential conversions and parameter types.
79
-
*
79
+
*
80
80
* @param raw can be {@literal null} or empty.
81
81
* @param accessor must not be {@literal null}.
82
82
* @param bindingContext must not be {@literal null}.
@@ -93,7 +93,7 @@ public String bind(String raw, MongoParameterAccessor accessor, BindingContext b
93
93
94
94
/**
95
95
* Replaced the parameter placeholders with the actual parameter values from the given {@link ParameterBinding}s.
96
-
*
96
+
*
97
97
* @param input must not be {@literal null} or empty.
98
98
* @param accessor must not be {@literal null}.
99
99
* @param bindingContext must not be {@literal null}.
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/StringBasedMongoQuery.java
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/query/StringBasedMongoQueryUnitTests.java
+94-1Lines changed: 94 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,9 @@
28
28
29
29
importjavax.xml.bind.DatatypeConverter;
30
30
31
+
importcom.mongodb.BasicDBObject;
32
+
importcom.mongodb.DBObject;
33
+
importcom.mongodb.util.JSON;
31
34
importorg.bson.BSON;
32
35
importorg.bson.BsonRegularExpression;
33
36
importorg.bson.Document;
@@ -56,7 +59,7 @@
56
59
57
60
/**
58
61
* Unit tests for {@link StringBasedMongoQuery}.
59
-
*
62
+
*
60
63
* @author Oliver Gierke
61
64
* @author Christoph Strobl
62
65
* @author Thomas Darimont
@@ -435,6 +438,78 @@ public void shouldReplaceParametersInInQuotedExpressionOfNestedQueryOperator() t
0 commit comments