Module spring.data.elasticsearch
Interface ElasticsearchConverter
- All Superinterfaces:
EntityConverter<ElasticsearchPersistentEntity<?>,,ElasticsearchPersistentProperty, Object, Document> EntityReader<Object,,Document> EntityWriter<Object,Document>
- All Known Implementing Classes:
MappingElasticsearchConverter
public interface ElasticsearchConverter
extends EntityConverter<ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty,Object,Document>
- Author:
- Rizwan Idrees, Mohsin Husen, Christoph Strobl, Peter-Josef Meisch, Sasch Woo, Roman Puchkovskiy
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringConvert a given idValue to itsStringrepresentation taking potentially registeredConvertersinto account.default ProjectionFactoryGet the configuredProjectionFactory.default DocumentMap an object to aDocument.updateFieldNames(String propertyPath, ElasticsearchPersistentEntity<?> persistentEntity) Replaces the parts in a dot separated property path with the field names of the respective properties.voidupdateQuery(Query query, Class<?> domainClass) Updates aQueryby renaming the property names in the query to the correct mapped field names and the values to the converted values if theElasticsearchPersistentPropertyfor a property has aPropertyValueConverter.Methods inherited from interface org.springframework.data.convert.EntityConverter
getConversionService, getMappingContextMethods inherited from interface org.springframework.data.convert.EntityReader
readMethods inherited from interface org.springframework.data.convert.EntityWriter
write
-
Method Details
-
getProjectionFactory
Get the configuredProjectionFactory.
NOTE Should be overwritten in implementation to make use of the type cache.- Since:
- 3.2
-
convertId
Convert a given idValue to itsStringrepresentation taking potentially registeredConvertersinto account.- Parameters:
idValue- must not be null.- Returns:
- never null.
- Since:
- 3.2
-
mapObject
Map an object to aDocument.- Parameters:
source- the object to map- Returns:
- will not be null.
-
updateQuery
Updates aQueryby renaming the property names in the query to the correct mapped field names and the values to the converted values if theElasticsearchPersistentPropertyfor a property has aPropertyValueConverter. If domainClass is null it's a noop.- Parameters:
query- the query that is internally updated, must not be nulldomainClass- the class of the object that is searched with the query
-
updateFieldNames
Replaces the parts in a dot separated property path with the field names of the respective properties. If no matching property is found, the original parts are rteturned.- Parameters:
propertyPath- the property pathpersistentEntity- the replaced values.- Returns:
- a String wihere the property names are replaced with field names
- Since:
- 5.2
-