@@ -143,33 +143,29 @@ public String getDescription() {
143
143
* @return the resulting predicate
144
144
*/
145
145
protected Predicate buildPredicate (DataFetchingEnvironment environment ) {
146
- MultiValueMap <String , Object > parameters = new LinkedMultiValueMap <>();
147
146
QuerydslBindings bindings = new QuerydslBindings ();
148
-
149
147
EntityPath <?> path = SimpleEntityPathResolver .INSTANCE .createPath (this .domainType .getType ());
150
148
this .customizer .customize (bindings , path );
151
149
152
- parameters .putAll (flatten (null , getArgumentValues (environment )));
150
+ MultiValueMap <String , Object > parameters = new LinkedMultiValueMap <>();
151
+ addParameters (null , getArgumentValues (environment ), parameters );
153
152
154
153
return BUILDER .getPredicate (this .domainType , parameters , bindings );
155
154
}
156
155
157
156
@ SuppressWarnings ("unchecked" )
158
- private MultiValueMap < String , Object > flatten ( @ Nullable String prefix , Map < String , Object > inputParameters ) {
159
- MultiValueMap <String , Object > parameters = new LinkedMultiValueMap <>();
157
+ private void addParameters (
158
+ @ Nullable String prefix , Map <String , Object > arguments , MultiValueMap < String , Object > parameters ) {
160
159
161
- for (Map .Entry <String , Object > entry : inputParameters .entrySet ()) {
160
+ for (Map .Entry <String , Object > entry : arguments .entrySet ()) {
162
161
Object value = entry .getValue ();
163
162
if (value instanceof Map <?, ?> nested ) {
164
- parameters .addAll (flatten (entry .getKey (), (Map <String , Object >) nested ));
165
- }
166
- else {
167
- List <Object > values = (value instanceof List ) ? (List <Object >) value : Collections .singletonList (value );
168
- parameters .put (((prefix != null ) ? prefix + "." : "" ) + entry .getKey (), values );
163
+ addParameters (entry .getKey (), (Map <String , Object >) nested , parameters );
164
+ continue ;
169
165
}
166
+ List <Object > values = (value instanceof List ) ? (List <Object >) value : Collections .singletonList (value );
167
+ parameters .put (((prefix != null ) ? prefix + "." : "" ) + entry .getKey (), values );
170
168
}
171
-
172
- return parameters ;
173
169
}
174
170
175
171
/**
0 commit comments