27
27
import org .reactivestreams .Publisher ;
28
28
29
29
import org .springframework .core .convert .converter .Converter ;
30
- import org .springframework .core .env .StandardEnvironment ;
31
30
import org .springframework .data .expression .ReactiveValueEvaluationContextProvider ;
32
31
import org .springframework .data .expression .ValueEvaluationContext ;
33
32
import org .springframework .data .expression .ValueEvaluationContextProvider ;
34
33
import org .springframework .data .expression .ValueExpression ;
35
- import org .springframework .data .expression .ValueExpressionParser ;
36
34
import org .springframework .data .mapping .model .EntityInstantiators ;
37
- import org .springframework .data .mapping .model .SpELExpressionEvaluator ;
38
35
import org .springframework .data .mapping .model .ValueExpressionEvaluator ;
39
36
import org .springframework .data .mongodb .core .MongoOperations ;
40
37
import org .springframework .data .mongodb .core .ReactiveFindOperation .FindWithProjection ;
56
53
import org .springframework .data .mongodb .util .json .ParameterBindingContext ;
57
54
import org .springframework .data .mongodb .util .json .ParameterBindingDocumentCodec ;
58
55
import org .springframework .data .repository .query .ParameterAccessor ;
59
- import org .springframework .data .repository .query .QueryMethodValueEvaluationContextAccessor ;
60
- import org .springframework .data .repository .query .ReactiveQueryMethodEvaluationContextProvider ;
61
56
import org .springframework .data .repository .query .RepositoryQuery ;
62
57
import org .springframework .data .repository .query .ResultProcessor ;
63
58
import org .springframework .data .repository .query .ValueExpressionDelegate ;
64
59
import org .springframework .data .spel .ExpressionDependencies ;
65
- import org .springframework .expression .ExpressionParser ;
66
- import org .springframework .expression .spel .standard .SpelExpressionParser ;
67
60
import org .springframework .lang .Nullable ;
68
61
import org .springframework .util .Assert ;
69
62
import org .springframework .util .ObjectUtils ;
@@ -89,45 +82,6 @@ public abstract class AbstractReactiveMongoQuery implements RepositoryQuery {
89
82
private final ValueExpressionDelegate valueExpressionDelegate ;
90
83
private final ReactiveValueEvaluationContextProvider valueEvaluationContextProvider ;
91
84
92
- /**
93
- * Creates a new {@link AbstractReactiveMongoQuery} from the given {@link MongoQueryMethod} and
94
- * {@link MongoOperations}.
95
- *
96
- * @param method must not be {@literal null}.
97
- * @param operations must not be {@literal null}.
98
- * @param expressionParser must not be {@literal null}.
99
- * @param evaluationContextProvider must not be {@literal null}.
100
- * @deprecated use the constructor version with {@link ValueExpressionDelegate}
101
- */
102
- @ Deprecated (since = "4.4.0" )
103
- public AbstractReactiveMongoQuery (ReactiveMongoQueryMethod method , ReactiveMongoOperations operations ,
104
- ExpressionParser expressionParser , ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider ) {
105
-
106
- Assert .notNull (method , "MongoQueryMethod must not be null" );
107
- Assert .notNull (operations , "ReactiveMongoOperations must not be null" );
108
- Assert .notNull (expressionParser , "SpelExpressionParser must not be null" );
109
- Assert .notNull (evaluationContextProvider , "ReactiveEvaluationContextExtension must not be null" );
110
-
111
- this .method = method ;
112
- this .operations = operations ;
113
- this .instantiators = new EntityInstantiators ();
114
- this .valueExpressionDelegate = new ValueExpressionDelegate (
115
- new QueryMethodValueEvaluationContextAccessor (new StandardEnvironment (),
116
- evaluationContextProvider .getEvaluationContextProvider ()),
117
- ValueExpressionParser .create (() -> expressionParser ));
118
-
119
- MongoEntityMetadata <?> metadata = method .getEntityInformation ();
120
- Class <?> type = metadata .getCollectionEntity ().getType ();
121
-
122
- this .findOperationWithProjection = operations .query (type );
123
- this .updateOps = operations .update (type );
124
- ValueEvaluationContextProvider valueContextProvider = valueExpressionDelegate
125
- .createValueContextProvider (method .getParameters ());
126
- Assert .isInstanceOf (ReactiveValueEvaluationContextProvider .class , valueContextProvider ,
127
- "ValueEvaluationContextProvider must be reactive" );
128
- this .valueEvaluationContextProvider = (ReactiveValueEvaluationContextProvider ) valueContextProvider ;
129
- }
130
-
131
85
/**
132
86
* Creates a new {@link AbstractReactiveMongoQuery} from the given {@link MongoQueryMethod} and
133
87
* {@link MongoOperations}.
@@ -460,26 +414,6 @@ protected Mono<ParameterBindingDocumentCodec> getParameterBindingCodec() {
460
414
return getCodecRegistry ().map (ParameterBindingDocumentCodec ::new );
461
415
}
462
416
463
- /**
464
- * Obtain a {@link Mono publisher} emitting the {@link SpELExpressionEvaluator} suitable to evaluate expressions
465
- * backed by the given dependencies.
466
- *
467
- * @param dependencies must not be {@literal null}.
468
- * @param accessor must not be {@literal null}.
469
- * @return a {@link Mono} emitting the {@link SpELExpressionEvaluator} when ready.
470
- * @since 3.4
471
- * @deprecated since 4.4.0, use
472
- * {@link #getValueExpressionEvaluatorLater(ExpressionDependencies, MongoParameterAccessor)} instead
473
- */
474
- @ Deprecated (since = "4.4.0" )
475
- protected Mono <SpELExpressionEvaluator > getSpelEvaluatorFor (ExpressionDependencies dependencies ,
476
- MongoParameterAccessor accessor ) {
477
- return valueEvaluationContextProvider .getEvaluationContextLater (accessor .getValues (), dependencies )
478
- .map (evaluationContext -> (SpELExpressionEvaluator ) new DefaultSpELExpressionEvaluator (
479
- new SpelExpressionParser (), evaluationContext .getEvaluationContext ()))
480
- .defaultIfEmpty (DefaultSpELExpressionEvaluator .unsupported ());
481
- }
482
-
483
417
/**
484
418
* Obtain a {@link ValueExpressionEvaluator} suitable to evaluate expressions.
485
419
*
0 commit comments