mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-14 14:23: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
|
@Bean
|
||||||
public ElasticsearchCustomConversions elasticsearchCustomConversions() {
|
public ElasticsearchCustomConversions elasticsearchCustomConversions() {
|
||||||
return ElasticsearchCustomConversions.of(Collections.emptyList());
|
return new ElasticsearchCustomConversions(Collections.emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +43,7 @@ public class ElasticsearchCustomConversions extends CustomConversions {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
||||||
List<Converter<?, ?>> converters = new ArrayList<>();
|
List<Converter<?, ?>> converters = new ArrayList<>(GeoConverters.getConvertersToRegister());
|
||||||
converters.add(StringToUUIDConverter.INSTANCE);
|
converters.add(StringToUUIDConverter.INSTANCE);
|
||||||
converters.add(UUIDToStringConverter.INSTANCE);
|
converters.add(UUIDToStringConverter.INSTANCE);
|
||||||
converters.add(BigDecimalToDoubleConverter.INSTANCE);
|
converters.add(BigDecimalToDoubleConverter.INSTANCE);
|
||||||
@ -58,14 +58,8 @@ public class ElasticsearchCustomConversions extends CustomConversions {
|
|||||||
*
|
*
|
||||||
* @param converters must not be {@literal null}.
|
* @param converters must not be {@literal null}.
|
||||||
*/
|
*/
|
||||||
public static ElasticsearchCustomConversions of(Collection<Converter<?, ?>> converters) {
|
public ElasticsearchCustomConversions(Collection<?> converters) {
|
||||||
List<Converter<?, ?>> userConverters = new ArrayList<>(GeoConverters.getConvertersToRegister());
|
super(STORE_CONVERSIONS, converters);
|
||||||
userConverters.addAll(converters);
|
|
||||||
return new ElasticsearchCustomConversions(STORE_CONVERSIONS, userConverters);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ElasticsearchCustomConversions(StoreConversions storeConversions, Collection<?> converters) {
|
|
||||||
super(storeConversions, converters);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +85,7 @@ public class MappingElasticsearchConverter
|
|||||||
private final MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext;
|
private final MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext;
|
||||||
private final GenericConversionService conversionService;
|
private final GenericConversionService conversionService;
|
||||||
|
|
||||||
private CustomConversions conversions = ElasticsearchCustomConversions.of(Collections.emptyList());
|
private CustomConversions conversions = new ElasticsearchCustomConversions(Collections.emptyList());
|
||||||
private EntityInstantiators instantiators = new EntityInstantiators();
|
private EntityInstantiators instantiators = new EntityInstantiators();
|
||||||
|
|
||||||
private ElasticsearchTypeMapper typeMapper;
|
private ElasticsearchTypeMapper typeMapper;
|
||||||
|
@ -108,7 +108,7 @@ public class MappingElasticsearchConverterUnitTests {
|
|||||||
|
|
||||||
mappingElasticsearchConverter = new MappingElasticsearchConverter(mappingContext, new GenericConversionService());
|
mappingElasticsearchConverter = new MappingElasticsearchConverter(mappingContext, new GenericConversionService());
|
||||||
mappingElasticsearchConverter.setConversions(
|
mappingElasticsearchConverter.setConversions(
|
||||||
ElasticsearchCustomConversions.of(Arrays.asList(new ShotGunToMapConverter(), new MapToShotGunConverter())));
|
new ElasticsearchCustomConversions(Arrays.asList(new ShotGunToMapConverter(), new MapToShotGunConverter())));
|
||||||
mappingElasticsearchConverter.afterPropertiesSet();
|
mappingElasticsearchConverter.afterPropertiesSet();
|
||||||
|
|
||||||
sarahConnor = new Person();
|
sarahConnor = new Person();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user