|
15 | 15 | */ |
16 | 16 | package org.springframework.data.jdbc.repository.query; |
17 | 17 |
|
18 | | -import static org.springframework.data.jdbc.repository.query.JdbcQueryExecution.*; |
| 18 | +import static org.springframework.data.jdbc.repository.query.JdbcQueryExecution.ResultProcessingConverter; |
19 | 19 |
|
20 | 20 | import java.lang.reflect.Array; |
21 | 21 | import java.lang.reflect.Constructor; |
|
32 | 32 | import org.springframework.beans.BeanInstantiationException; |
33 | 33 | import org.springframework.beans.BeanUtils; |
34 | 34 | import org.springframework.beans.factory.BeanFactory; |
35 | | -import org.springframework.core.env.StandardEnvironment; |
36 | 35 | import org.springframework.data.expression.ValueEvaluationContext; |
37 | | -import org.springframework.data.expression.ValueExpressionParser; |
38 | 36 | import org.springframework.data.jdbc.core.convert.JdbcColumnTypes; |
39 | 37 | import org.springframework.data.jdbc.core.convert.JdbcConverter; |
40 | 38 | import org.springframework.data.jdbc.core.mapping.JdbcValue; |
41 | 39 | import org.springframework.data.jdbc.support.JdbcUtil; |
42 | | -import org.springframework.data.relational.core.dialect.SqlTypeResolver; |
43 | 40 | import org.springframework.data.relational.core.mapping.RelationalMappingContext; |
44 | 41 | import org.springframework.data.relational.repository.query.RelationalParameterAccessor; |
45 | 42 | import org.springframework.data.relational.repository.query.RelationalParametersParameterAccessor; |
46 | | -import org.springframework.data.repository.query.CachingValueExpressionDelegate; |
47 | 43 | import org.springframework.data.repository.query.Parameter; |
48 | 44 | import org.springframework.data.repository.query.Parameters; |
49 | 45 | import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; |
50 | | -import org.springframework.data.repository.query.QueryMethodValueEvaluationContextAccessor; |
51 | 46 | import org.springframework.data.repository.query.ResultProcessor; |
52 | 47 | import org.springframework.data.repository.query.ValueExpressionDelegate; |
53 | 48 | import org.springframework.data.repository.query.ValueExpressionQueryRewriter; |
@@ -92,6 +87,43 @@ public class StringBasedJdbcQuery extends AbstractJdbcQuery { |
92 | 87 | private final CachedResultSetExtractorFactory cachedResultSetExtractorFactory; |
93 | 88 | private final ValueExpressionDelegate delegate; |
94 | 89 |
|
| 90 | + /** |
| 91 | + * Creates a new {@link StringBasedJdbcQuery} for the given {@link JdbcQueryMethod}, {@link RelationalMappingContext} |
| 92 | + * and {@link RowMapper}. |
| 93 | + * |
| 94 | + * @param queryMethod must not be {@literal null}. |
| 95 | + * @param operations must not be {@literal null}. |
| 96 | + * @param defaultRowMapper can be {@literal null} (only in case of a modifying query). |
| 97 | + * @deprecated since 3.4, use the constructors accepting {@link ValueExpressionDelegate} instead. |
| 98 | + */ |
| 99 | + @Deprecated(since = "3.4") |
| 100 | + public StringBasedJdbcQuery(JdbcQueryMethod queryMethod, NamedParameterJdbcOperations operations, |
| 101 | + @Nullable RowMapper<?> defaultRowMapper, JdbcConverter converter, |
| 102 | + QueryMethodEvaluationContextProvider evaluationContextProvider) { |
| 103 | + this(queryMethod.getRequiredQuery(), queryMethod, operations, result -> (RowMapper<Object>) defaultRowMapper, |
| 104 | + converter, evaluationContextProvider); |
| 105 | + } |
| 106 | + |
| 107 | + /** |
| 108 | + * Creates a new {@link StringBasedJdbcQuery} for the given {@link JdbcQueryMethod}, {@link RelationalMappingContext} |
| 109 | + * and {@link RowMapperFactory}. |
| 110 | + * |
| 111 | + * @param queryMethod must not be {@literal null}. |
| 112 | + * @param operations must not be {@literal null}. |
| 113 | + * @param rowMapperFactory must not be {@literal null}. |
| 114 | + * @param converter must not be {@literal null}. |
| 115 | + * @param evaluationContextProvider must not be {@literal null}. |
| 116 | + * @since 2.3 |
| 117 | + * @deprecated use alternative constructor |
| 118 | + */ |
| 119 | + @Deprecated(since = "3.4") |
| 120 | + public StringBasedJdbcQuery(JdbcQueryMethod queryMethod, NamedParameterJdbcOperations operations, |
| 121 | + RowMapperFactory rowMapperFactory, JdbcConverter converter, |
| 122 | + QueryMethodEvaluationContextProvider evaluationContextProvider) { |
| 123 | + this(queryMethod.getRequiredQuery(), queryMethod, operations, rowMapperFactory, converter, |
| 124 | + evaluationContextProvider); |
| 125 | + } |
| 126 | + |
95 | 127 | /** |
96 | 128 | * Creates a new {@link StringBasedJdbcQuery} for the given {@link JdbcQueryMethod}, {@link RelationalMappingContext} |
97 | 129 | * and {@link RowMapperFactory}. |
|
0 commit comments