Skip to content

Adopt to deprecated QueryMethod constructor #2049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,14 @@ public JdbcQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFac
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;
this.annotationCache = new ConcurrentReferenceHashMap<>();
this.modifyingQuery = AnnotationUtils.findAnnotation(method, Modifying.class) != null;
}

@Override
protected Parameters<?, ?> createParameters(ParametersSource parametersSource) {
return new JdbcParameters(parametersSource);
}

@Override
@SuppressWarnings("unchecked")
public RelationalEntityMetadata<?> getEntityInformation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -123,11 +123,6 @@ public R2dbcQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFa
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()
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private QueryMethod getQueryMethod(String methodName, Class<?>... parameterTypes
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private ParameterMetadata getParameterMetadata(String methodName, Object value)
static class RelationalQueryMethod extends QueryMethod {

public RelationalQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) {
super(method, metadata, factory);
super(method, metadata, factory, RelationalParameters::new);
}
}

Expand Down