18
18
import static org .springframework .ldap .query .LdapQueryBuilder .*;
19
19
20
20
import org .springframework .data .expression .ValueEvaluationContext ;
21
+ import org .springframework .data .expression .ValueEvaluationContextProvider ;
21
22
import org .springframework .data .ldap .repository .Query ;
22
23
import org .springframework .data .mapping .PersistentEntity ;
23
24
import org .springframework .data .mapping .PersistentProperty ;
@@ -67,6 +68,7 @@ public AnnotatedLdapRepositoryQuery(LdapQueryMethod queryMethod, Class<?> entity
67
68
* @param mappingContext must not be {@literal null}.
68
69
* @param instantiators must not be {@literal null}.
69
70
* @param valueExpressionDelegate must not be {@literal null}
71
+ * @since 3.4
70
72
*/
71
73
public AnnotatedLdapRepositoryQuery (LdapQueryMethod queryMethod , Class <?> entityType , LdapOperations ldapOperations ,
72
74
MappingContext <? extends PersistentEntity <?, ?>, ? extends PersistentProperty <?>> mappingContext ,
@@ -85,8 +87,10 @@ public AnnotatedLdapRepositoryQuery(LdapQueryMethod queryMethod, Class<?> entity
85
87
86
88
@ Override
87
89
protected LdapQuery createQuery (LdapParameterAccessor parameters ) {
88
- ValueEvaluationContext evaluationContext = valueExpressionDelegate .createValueContextProvider (
89
- getQueryMethod ().getParameters ()).getEvaluationContext (parameters .getBindableParameterValues (), stringBasedQuery .getExpressionDependencies ());
90
+ ValueEvaluationContextProvider valueContextProvider = valueExpressionDelegate .createValueContextProvider (
91
+ getQueryMethod ().getParameters ());
92
+ ValueEvaluationContext evaluationContext = valueContextProvider .getEvaluationContext (
93
+ parameters .getBindableParameterValues (), stringBasedQuery .getExpressionDependencies ());
90
94
String boundQuery = stringBasedQuery .bindQuery (parameters ,
91
95
new ContextualValueExpressionEvaluator (valueExpressionDelegate , evaluationContext ));
92
96
0 commit comments