public class MappingElasticsearchConverter extends Object implements ElasticsearchConverter, ApplicationContextAware, InitializingBean
EntityConverter
implementation based on domain type
metadata
.Constructor and Description |
---|
MappingElasticsearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext) |
MappingElasticsearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext,
GenericConversionService conversionService) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
ConversionService |
getConversionService() |
MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> |
getMappingContext() |
<R> R |
read(Class<R> type,
Document source) |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setConversions(CustomConversions conversions)
Set the
CustomConversions to be applied during the mapping process. |
void |
updateQuery(Query query,
Class<?> domainClass)
Updates a
Query by renaming the property names in the query to the correct mapped field names and the
values to the converted values if the ElasticsearchPersistentProperty for a property has a
ElasticsearchPersistentPropertyConverter . |
void |
write(Object source,
Document sink) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertId, getProjectionFactory, mapObject
public MappingElasticsearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext)
public MappingElasticsearchConverter(MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> mappingContext, @Nullable GenericConversionService conversionService)
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> getMappingContext()
getMappingContext
in interface EntityConverter<ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty,Object,Document>
public ConversionService getConversionService()
getConversionService
in interface EntityConverter<ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty,Object,Document>
public void setConversions(CustomConversions conversions)
CustomConversions
to be applied during the mapping process. bean initialization
.conversions
- must not be null.public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public <R> R read(Class<R> type, Document source)
read
in interface EntityReader<Object,Document>
public void write(Object source, Document sink)
write
in interface EntityWriter<Object,Document>
public void updateQuery(Query query, @Nullable Class<?> domainClass)
ElasticsearchConverter
Query
by renaming the property names in the query to the correct mapped field names and the
values to the converted values if the ElasticsearchPersistentProperty
for a property has a
ElasticsearchPersistentPropertyConverter
. If
domainClass is null it's a noop.updateQuery
in interface ElasticsearchConverter
query
- the query that is internally updated, must not be nulldomainClass
- the class of the object that is searched with the queryCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.