mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-14 06:13:26 +00:00
DATAES-743 - Revert geo converters to back to store converters.
Original PR: #390
This commit is contained in:
parent
b2ffc236bf
commit
9c64dd9c39
@ -76,7 +76,7 @@ public class ElasticsearchConfigurationSupport {
|
||||
*/
|
||||
@Bean
|
||||
public ElasticsearchCustomConversions elasticsearchCustomConversions() {
|
||||
return ElasticsearchCustomConversions.of(Collections.emptyList());
|
||||
return new ElasticsearchCustomConversions(Collections.emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@ public class ElasticsearchCustomConversions extends CustomConversions {
|
||||
|
||||
static {
|
||||
|
||||
List<Converter<?, ?>> converters = new ArrayList<>();
|
||||
List<Converter<?, ?>> converters = new ArrayList<>(GeoConverters.getConvertersToRegister());
|
||||
converters.add(StringToUUIDConverter.INSTANCE);
|
||||
converters.add(UUIDToStringConverter.INSTANCE);
|
||||
converters.add(BigDecimalToDoubleConverter.INSTANCE);
|
||||
@ -58,14 +58,8 @@ public class ElasticsearchCustomConversions extends CustomConversions {
|
||||
*
|
||||
* @param converters must not be {@literal null}.
|
||||
*/
|
||||
public static ElasticsearchCustomConversions of(Collection<Converter<?, ?>> converters) {
|
||||
List<Converter<?, ?>> userConverters = new ArrayList<>(GeoConverters.getConvertersToRegister());
|
||||
userConverters.addAll(converters);
|
||||
return new ElasticsearchCustomConversions(STORE_CONVERSIONS, userConverters);
|
||||
}
|
||||
|
||||
private ElasticsearchCustomConversions(StoreConversions storeConversions, Collection<?> converters) {
|
||||
super(storeConversions, converters);
|
||||
public ElasticsearchCustomConversions(Collection<?> converters) {
|
||||
super(STORE_CONVERSIONS, converters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,7 +85,7 @@ public class MappingElasticsearchConverter
|
||||
private final MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext;
|
||||
private final GenericConversionService conversionService;
|
||||
|
||||
private CustomConversions conversions = ElasticsearchCustomConversions.of(Collections.emptyList());
|
||||
private CustomConversions conversions = new ElasticsearchCustomConversions(Collections.emptyList());
|
||||
private EntityInstantiators instantiators = new EntityInstantiators();
|
||||
|
||||
private ElasticsearchTypeMapper typeMapper;
|
||||
|
@ -108,7 +108,7 @@ public class MappingElasticsearchConverterUnitTests {
|
||||
|
||||
mappingElasticsearchConverter = new MappingElasticsearchConverter(mappingContext, new GenericConversionService());
|
||||
mappingElasticsearchConverter.setConversions(
|
||||
ElasticsearchCustomConversions.of(Arrays.asList(new ShotGunToMapConverter(), new MapToShotGunConverter())));
|
||||
new ElasticsearchCustomConversions(Arrays.asList(new ShotGunToMapConverter(), new MapToShotGunConverter())));
|
||||
mappingElasticsearchConverter.afterPropertiesSet();
|
||||
|
||||
sarahConnor = new Person();
|
||||
|
Loading…
x
Reference in New Issue
Block a user