DATAES-743 - Revert geo converters to back to store converters.

Original PR: #390
This commit is contained in:
Peter-Josef Meisch 2020-02-11 18:33:58 +01:00 committed by GitHub
parent b2ffc236bf
commit 9c64dd9c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 12 deletions

View File

@ -76,7 +76,7 @@ public class ElasticsearchConfigurationSupport {
*/
@Bean
public ElasticsearchCustomConversions elasticsearchCustomConversions() {
return ElasticsearchCustomConversions.of(Collections.emptyList());
return new ElasticsearchCustomConversions(Collections.emptyList());
}
/**

View File

@ -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);
}
/**

View File

@ -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;

View File

@ -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();