Upgrade to Spring Data 2021.2.0.

Closes gh-696
This commit is contained in:
Mark Paluch
2022-05-17 16:22:26 +02:00
parent c0f81dfa75
commit 978cf7bd78
4 changed files with 12 additions and 9 deletions

View File

@@ -28,7 +28,7 @@
<mockk.version>1.10.3-jdk8</mockk.version>
<mockito-core.version>3.8.0</mockito-core.version>
<spring.version>5.3.20</spring.version>
<spring-data-bom.version>2020.0.5</spring-data-bom.version>
<spring-data-bom.version>2021.2.0</spring-data-bom.version>
<spring-security-bom.version>5.4.5</spring-security-bom.version>
<reactor.version>2020.0.13</reactor.version>
<java.version>1.8</java.version>

View File

@@ -19,7 +19,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.data.convert.CustomConversions;
import org.springframework.data.convert.EntityInstantiators;
import org.springframework.data.mapping.model.EntityInstantiators;
/**
* Base class for {@link VaultConverter} implementations. Sets up a

View File

@@ -26,12 +26,12 @@ import java.util.Optional;
import org.springframework.core.CollectionFactory;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.data.convert.EntityInstantiator;
import org.springframework.data.mapping.MappingException;
import org.springframework.data.mapping.Parameter;
import org.springframework.data.mapping.PersistentPropertyAccessor;
import org.springframework.data.mapping.PreferredConstructor.Parameter;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.mapping.model.ConvertingPropertyAccessor;
import org.springframework.data.mapping.model.EntityInstantiator;
import org.springframework.data.mapping.model.ParameterValueProvider;
import org.springframework.data.mapping.model.PersistentEntityParameterValueProvider;
import org.springframework.data.mapping.model.PropertyValueProvider;
@@ -156,7 +156,6 @@ public class MappingVaultConverter extends AbstractVaultConverter {
@Nullable
@Override
public <T> T getParameterValue(Parameter<T, VaultPersistentProperty> parameter) {
Object value = parameterProvider.getParameterValue(parameter);
return value != null ? readValue(value, parameter.getType()) : null;
}

View File

@@ -16,6 +16,7 @@
package org.springframework.vault.repository.query;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
import org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.repository.query.ParameterAccessor;
@@ -44,7 +45,7 @@ public class VaultPartTreeQuery extends KeyValuePartTreeQuery {
* @param keyValueOperations must not be {@literal null}.
* @param queryCreator must not be {@literal null}.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public VaultPartTreeQuery(QueryMethod queryMethod, QueryMethodEvaluationContextProvider evaluationContextProvider,
KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
@@ -52,7 +53,8 @@ public class VaultPartTreeQuery extends KeyValuePartTreeQuery {
new VaultQueryCreatorFactory((MappingContext) keyValueOperations.getMappingContext()));
}
static class VaultQueryCreatorFactory implements QueryCreatorFactory<VaultQueryCreator> {
static class VaultQueryCreatorFactory
implements KeyValuePartTreeQuery.QueryCreatorFactory<AbstractQueryCreator<KeyValueQuery<?>, ?>> {
private final MappingContext<VaultPersistentEntity<?>, VaultPersistentProperty> mappingContext;
@@ -62,8 +64,10 @@ public class VaultPartTreeQuery extends KeyValuePartTreeQuery {
}
@Override
public VaultQueryCreator queryCreatorFor(PartTree partTree, ParameterAccessor accessor) {
return new VaultQueryCreator(partTree, accessor, this.mappingContext);
@SuppressWarnings({ "unchecked", "rawtypes" })
public AbstractQueryCreator<KeyValueQuery<?>, ?> queryCreatorFor(PartTree partTree,
ParameterAccessor accessor) {
return (AbstractQueryCreator) new VaultQueryCreator(partTree, accessor, this.mappingContext);
}
}