Module spring.data.elasticsearch
Class EntityOperations
java.lang.Object
org.springframework.data.elasticsearch.core.EntityOperations
Common operations performed on an entity in the context of it's mapping metadata.
- Since:
- 3.2
- Author:
- Mark Paluch, Christoph Strobl, Peter-Josef Meisch, Roman Puchkovskiy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInformation and commands on an entity. -
Constructor Summary
ConstructorsConstructorDescriptionEntityOperations(MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> context) -
Method Summary
Modifier and TypeMethodDescriptionforEntity(T entity, ConversionService conversionService, RoutingResolver routingResolver) Creates a newEntityOperations.AdaptableEntityfor the given bean andConversionServiceandRoutingResolver.<T> TupdateIndexedObject(T entity, IndexedObjectInformation indexedObjectInformation, ElasticsearchConverter elasticsearchConverter, RoutingResolver routingResolver) Updates an entity after it is stored in Elasticsearch with additional data like id, version, seqno...
-
Constructor Details
-
EntityOperations
public EntityOperations(MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> context)
-
-
Method Details
-
forEntity
public <T> EntityOperations.AdaptableEntity<T> forEntity(T entity, ConversionService conversionService, RoutingResolver routingResolver) Creates a newEntityOperations.AdaptableEntityfor the given bean andConversionServiceandRoutingResolver.- Parameters:
entity- must not be null.conversionService- must not be null.routingResolver- theRoutingResolver, must not be null- Returns:
- the
EntityOperations.AdaptableEntity
-
updateIndexedObject
public <T> T updateIndexedObject(T entity, IndexedObjectInformation indexedObjectInformation, ElasticsearchConverter elasticsearchConverter, RoutingResolver routingResolver) Updates an entity after it is stored in Elasticsearch with additional data like id, version, seqno...- Type Parameters:
T- the entity class- Parameters:
entity- the entity to updateindexedObjectInformation- the update informationelasticsearchConverter- the converter providing necessary mapping informationroutingResolver- routing resolver to use- Returns:
-