Browse Source

Fix broken merge.

See #1721
Original pull request #1722
3.2.x
Jens Schauder 2 years ago
parent
commit
792d773cbd
No known key found for this signature in database
GPG Key ID: 89F36EDF8C1BEA56
  1. 8
      spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/JdbcQueryMethod.java
  2. 15
      spring-data-relational/src/main/java/org/springframework/data/relational/repository/query/RelationalParameters.java

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

@ -28,10 +28,11 @@ import org.springframework.data.relational.core.mapping.RelationalPersistentEnti
import org.springframework.data.relational.core.mapping.RelationalPersistentProperty; import org.springframework.data.relational.core.mapping.RelationalPersistentProperty;
import org.springframework.data.relational.repository.Lock; import org.springframework.data.relational.repository.Lock;
import org.springframework.data.relational.repository.query.RelationalEntityMetadata; import org.springframework.data.relational.repository.query.RelationalEntityMetadata;
import org.springframework.data.relational.repository.query.RelationalParameters;
import org.springframework.data.relational.repository.query.SimpleRelationalEntityMetadata; import org.springframework.data.relational.repository.query.SimpleRelationalEntityMetadata;
import org.springframework.data.repository.core.NamedQueries; import org.springframework.data.repository.core.NamedQueries;
import org.springframework.data.repository.core.RepositoryMetadata; import org.springframework.data.repository.core.RepositoryMetadata;
import org.springframework.data.repository.query.Parameters;
import org.springframework.data.repository.query.ParametersSource;
import org.springframework.data.repository.query.QueryMethod; import org.springframework.data.repository.query.QueryMethod;
import org.springframework.jdbc.core.ResultSetExtractor; import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;
@ -67,6 +68,7 @@ public class JdbcQueryMethod extends QueryMethod {
MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> mappingContext) { MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> mappingContext) {
super(method, metadata, factory); super(method, metadata, factory);
this.namedQueries = namedQueries; this.namedQueries = namedQueries;
this.method = method; this.method = method;
this.mappingContext = mappingContext; this.mappingContext = mappingContext;
@ -75,8 +77,8 @@ public class JdbcQueryMethod extends QueryMethod {
} }
@Override @Override
protected RelationalParameters createParameters(Method method) { protected Parameters<?, ?> createParameters(ParametersSource parametersSource) {
return new JdbcParameters(method); return new JdbcParameters(parametersSource);
} }
@Override @Override

15
spring-data-relational/src/main/java/org/springframework/data/relational/repository/query/RelationalParameters.java

@ -24,6 +24,7 @@ import org.springframework.core.ResolvableType;
import org.springframework.data.relational.repository.query.RelationalParameters.RelationalParameter; import org.springframework.data.relational.repository.query.RelationalParameters.RelationalParameter;
import org.springframework.data.repository.query.Parameter; import org.springframework.data.repository.query.Parameter;
import org.springframework.data.repository.query.Parameters; import org.springframework.data.repository.query.Parameters;
import org.springframework.data.repository.query.ParametersSource;
import org.springframework.data.util.TypeInformation; import org.springframework.data.util.TypeInformation;
/** /**
@ -43,7 +44,7 @@ public class RelationalParameters extends Parameters<RelationalParameters, Relat
} }
protected RelationalParameters(ParametersSource parametersSource, protected RelationalParameters(ParametersSource parametersSource,
Function<MethodParameter, RelationalParameter> parameterFactory) { Function<MethodParameter, RelationalParameter> parameterFactory) {
super(parametersSource, parameterFactory); super(parametersSource, parameterFactory);
} }
@ -81,6 +82,18 @@ public class RelationalParameters extends Parameters<RelationalParameters, Relat
this.typeInformation = TypeInformation.fromMethodParameter(parameter); this.typeInformation = TypeInformation.fromMethodParameter(parameter);
} }
/**
* Creates a new {@link RelationalParameter}.
*
* @param parameter must not be {@literal null}.
*/
protected RelationalParameter(MethodParameter parameter, TypeInformation<?> domainType) {
super(parameter, domainType);
this.typeInformation = TypeInformation.fromMethodParameter(parameter);
}
public ResolvableType getResolvableType() { public ResolvableType getResolvableType() {
return getTypeInformation().toTypeDescriptor().getResolvableType(); return getTypeInformation().toTypeDescriptor().getResolvableType();
} }

Loading…
Cancel
Save