Skip to content

Commit e49a736

Browse files
committed
Adopt to deprecated QueryMethod constructor
1 parent e6fe49d commit e49a736

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/JdbcQueryMethod.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,14 @@ public JdbcQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFac
6767
NamedQueries namedQueries,
6868
MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> mappingContext) {
6969

70-
super(method, metadata, factory);
70+
super(method, metadata, factory, JdbcParameters::new);
7171
this.namedQueries = namedQueries;
7272
this.method = method;
7373
this.mappingContext = mappingContext;
7474
this.annotationCache = new ConcurrentReferenceHashMap<>();
7575
this.modifyingQuery = AnnotationUtils.findAnnotation(method, Modifying.class) != null;
7676
}
7777

78-
@Override
79-
protected Parameters<?, ?> createParameters(ParametersSource parametersSource) {
80-
return new JdbcParameters(parametersSource);
81-
}
82-
8378
@Override
8479
@SuppressWarnings("unchecked")
8580
public RelationalEntityMetadata<?> getEntityInformation() {

spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/repository/query/R2dbcQueryMethod.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class R2dbcQueryMethod extends QueryMethod {
8383
public R2dbcQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory projectionFactory,
8484
MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> mappingContext) {
8585

86-
super(method, metadata, projectionFactory);
86+
super(method, metadata, projectionFactory, RelationalParameters::new);
8787

8888
Assert.notNull(mappingContext, "MappingContext must not be null");
8989

@@ -123,11 +123,6 @@ public R2dbcQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFa
123123
this.lock = Optional.ofNullable(AnnotatedElementUtils.findMergedAnnotation(method, Lock.class));
124124
}
125125

126-
@Override
127-
protected RelationalParameters createParameters(ParametersSource parametersSource) {
128-
return new RelationalParameters(parametersSource);
129-
}
130-
131126
/* (non-Javadoc)
132127
* @see org.springframework.data.repository.query.QueryMethod#isCollectionQuery()
133128
*/

spring-data-relational/src/test/java/org/springframework/data/relational/repository/query/CriteriaFactoryUnitTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private QueryMethod getQueryMethod(String methodName, Class<?>... parameterTypes
7878
throw new RuntimeException(e);
7979
}
8080
return new QueryMethod(method, new DefaultRepositoryMetadata(UserRepository.class),
81-
new SpelAwareProxyProjectionFactory());
81+
new SpelAwareProxyProjectionFactory(), RelationalParameters::new);
8282
}
8383

8484
private RelationalParametersParameterAccessor getAccessor(QueryMethod queryMethod, Object... values) {

spring-data-relational/src/test/java/org/springframework/data/relational/repository/query/ParameterMetadataProviderUnitTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private ParameterMetadata getParameterMetadata(String methodName, Object value)
8282
static class RelationalQueryMethod extends QueryMethod {
8383

8484
public RelationalQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) {
85-
super(method, metadata, factory);
85+
super(method, metadata, factory, RelationalParameters::new);
8686
}
8787
}
8888

0 commit comments

Comments
 (0)