Adopt to deprecated QueryMethod constructor.

Original pull request: #2049
Closes: #2025
This commit is contained in:
Daeho Kwon
2025-04-29 22:27:55 +09:00
committed by Jens Schauder
parent e6fe49dd59
commit e88f4fe299
4 changed files with 4 additions and 14 deletions

View File

@@ -67,7 +67,7 @@ public class JdbcQueryMethod extends QueryMethod {
NamedQueries namedQueries,
MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> mappingContext) {
super(method, metadata, factory);
super(method, metadata, factory, JdbcParameters::new);
this.namedQueries = namedQueries;
this.method = method;
this.mappingContext = mappingContext;
@@ -75,11 +75,6 @@ public class JdbcQueryMethod extends QueryMethod {
this.modifyingQuery = AnnotationUtils.findAnnotation(method, Modifying.class) != null;
}
@Override
protected Parameters<?, ?> createParameters(ParametersSource parametersSource) {
return new JdbcParameters(parametersSource);
}
@Override
@SuppressWarnings("unchecked")
public RelationalEntityMetadata<?> getEntityInformation() {

View File

@@ -83,7 +83,7 @@ public class R2dbcQueryMethod extends QueryMethod {
public R2dbcQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory projectionFactory,
MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> mappingContext) {
super(method, metadata, projectionFactory);
super(method, metadata, projectionFactory, RelationalParameters::new);
Assert.notNull(mappingContext, "MappingContext must not be null");
@@ -123,11 +123,6 @@ public class R2dbcQueryMethod extends QueryMethod {
this.lock = Optional.ofNullable(AnnotatedElementUtils.findMergedAnnotation(method, Lock.class));
}
@Override
protected RelationalParameters createParameters(ParametersSource parametersSource) {
return new RelationalParameters(parametersSource);
}
/* (non-Javadoc)
* @see org.springframework.data.repository.query.QueryMethod#isCollectionQuery()
*/

View File

@@ -78,7 +78,7 @@ public class CriteriaFactoryUnitTests {
throw new RuntimeException(e);
}
return new QueryMethod(method, new DefaultRepositoryMetadata(UserRepository.class),
new SpelAwareProxyProjectionFactory());
new SpelAwareProxyProjectionFactory(), RelationalParameters::new);
}
private RelationalParametersParameterAccessor getAccessor(QueryMethod queryMethod, Object... values) {

View File

@@ -82,7 +82,7 @@ public class ParameterMetadataProviderUnitTests {
static class RelationalQueryMethod extends QueryMethod {
public RelationalQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) {
super(method, metadata, factory);
super(method, metadata, factory, RelationalParameters::new);
}
}