mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-22 20:12:11 +00:00
Adapt to changes in entity creation metadata APIs in Spring Data Commons.
This commit is contained in:
parent
32fa7391c4
commit
db59ac2a03
@ -47,9 +47,10 @@ import org.springframework.data.elasticsearch.core.query.Field;
|
|||||||
import org.springframework.data.elasticsearch.core.query.Query;
|
import org.springframework.data.elasticsearch.core.query.Query;
|
||||||
import org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm;
|
import org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm;
|
||||||
import org.springframework.data.elasticsearch.core.query.SourceFilter;
|
import org.springframework.data.elasticsearch.core.query.SourceFilter;
|
||||||
|
import org.springframework.data.mapping.InstanceCreatorMetadata;
|
||||||
import org.springframework.data.mapping.MappingException;
|
import org.springframework.data.mapping.MappingException;
|
||||||
|
import org.springframework.data.mapping.Parameter;
|
||||||
import org.springframework.data.mapping.PersistentPropertyAccessor;
|
import org.springframework.data.mapping.PersistentPropertyAccessor;
|
||||||
import org.springframework.data.mapping.PreferredConstructor;
|
|
||||||
import org.springframework.data.mapping.SimplePropertyHandler;
|
import org.springframework.data.mapping.SimplePropertyHandler;
|
||||||
import org.springframework.data.mapping.context.MappingContext;
|
import org.springframework.data.mapping.context.MappingContext;
|
||||||
import org.springframework.data.mapping.model.*;
|
import org.springframework.data.mapping.model.*;
|
||||||
@ -307,11 +308,10 @@ public class MappingElasticsearchConverter
|
|||||||
SpELExpressionEvaluator evaluator = new DefaultSpELExpressionEvaluator(source, spELContext);
|
SpELExpressionEvaluator evaluator = new DefaultSpELExpressionEvaluator(source, spELContext);
|
||||||
MapValueAccessor accessor = new MapValueAccessor(source);
|
MapValueAccessor accessor = new MapValueAccessor(source);
|
||||||
|
|
||||||
PreferredConstructor<?, ElasticsearchPersistentProperty> persistenceConstructor = entity
|
InstanceCreatorMetadata<?> creatorMetadata = entity.getInstanceCreatorMetadata();
|
||||||
.getPersistenceConstructor();
|
|
||||||
|
|
||||||
ParameterValueProvider<ElasticsearchPersistentProperty> propertyValueProvider = persistenceConstructor != null
|
ParameterValueProvider<ElasticsearchPersistentProperty> propertyValueProvider = creatorMetadata != null
|
||||||
&& persistenceConstructor.hasParameters() ? getParameterProvider(entity, accessor, evaluator)
|
&& creatorMetadata.hasParameters() ? getParameterProvider(entity, accessor, evaluator)
|
||||||
: NoOpParameterValueProvider.INSTANCE;
|
: NoOpParameterValueProvider.INSTANCE;
|
||||||
|
|
||||||
EntityInstantiator instantiator = instantiators.getInstantiatorFor(targetEntity);
|
EntityInstantiator instantiator = instantiators.getInstantiatorFor(targetEntity);
|
||||||
@ -649,8 +649,7 @@ public class MappingElasticsearchConverter
|
|||||||
* @see org.springframework.data.mapping.model.SpELExpressionParameterValueProvider#potentiallyConvertSpelValue(java.lang.Object, org.springframework.data.mapping.PreferredConstructor.Parameter)
|
* @see org.springframework.data.mapping.model.SpELExpressionParameterValueProvider#potentiallyConvertSpelValue(java.lang.Object, org.springframework.data.mapping.PreferredConstructor.Parameter)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected <T> T potentiallyConvertSpelValue(Object object,
|
protected <T> T potentiallyConvertSpelValue(Object object, Parameter<T, ElasticsearchPersistentProperty> parameter) {
|
||||||
PreferredConstructor.Parameter<T, ElasticsearchPersistentProperty> parameter) {
|
|
||||||
return readValue(object, parameter.getType());
|
return readValue(object, parameter.getType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -660,7 +659,7 @@ public class MappingElasticsearchConverter
|
|||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T getParameterValue(PreferredConstructor.Parameter<T, ElasticsearchPersistentProperty> parameter) {
|
public <T> T getParameterValue(Parameter<T, ElasticsearchPersistentProperty> parameter) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user