Module spring.data.elasticsearch
Class SimpleElasticsearchPersistentEntity<T>
java.lang.Object
org.springframework.data.mapping.model.BasicPersistentEntity<T,ElasticsearchPersistentProperty>
org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentEntity<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Iterable<ElasticsearchPersistentProperty>,Aware,EnvironmentAware,ElasticsearchPersistentEntity<T>,MutablePersistentEntity<T,,ElasticsearchPersistentProperty> PersistentEntity<T,ElasticsearchPersistentProperty>
public class SimpleElasticsearchPersistentEntity<T>
extends BasicPersistentEntity<T,ElasticsearchPersistentProperty>
implements ElasticsearchPersistentEntity<T>
Elasticsearch specific
PersistentEntity implementation holding- Author:
- Rizwan Idrees, Mohsin Husen, Mark Paluch, Sascha Woo, Ivan Greene, Peter-Josef Meisch, Roman Puchkovskiy, Subhobrata Dey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration settings passed in from the creatingSimpleElasticsearchMappingContext. -
Constructor Summary
ConstructorsConstructorDescriptionSimpleElasticsearchPersistentEntity(TypeInformation<T> typeInformation, SimpleElasticsearchPersistentEntity.ContextConfiguration contextConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionvoiddynamic()Retrieves the aliases associated with the current entity.returns the default settings for an index.Returns theJoinFieldproperty of theElasticsearchPersistentEntity.getPersistentPropertyWithFieldName(String fieldName) returns theElasticsearchPersistentPropertywith the given fieldName (can be set by theField) annotation.shortReturns theSeqNoPrimaryTermproperty of theElasticsearchPersistentEntity.shortbooleanReturns whether theElasticsearchPersistentEntityhas aJoinFieldproperty.booleanReturns whether theElasticsearchPersistentEntityhas aSeqNoPrimaryTermproperty.booleanbooleanbooleanresolveRouting(T bean) Resolves the routing for a bean.booleanbooleanbooleanMethods inherited from class org.springframework.data.mapping.model.BasicPersistentEntity
addAssociation, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getEvaluationContext, getEvaluationContext, getFallbackIsNewStrategy, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getType, getTypeAlias, getTypeInformation, getValueEvaluationContext, getValueEvaluationContext, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, iterator, requiresPropertyPopulation, returnPropertyIfBetterIdPropertyCandidateOrNull, setEnvironment, setEvaluationContextProvider, setPersistentPropertyAccessorFactory, verifyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity
getRequiredSeqNoPrimaryTermProperty, getVersionPropertyMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.springframework.data.mapping.PersistentEntity
doWithAll, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulation
-
Constructor Details
-
SimpleElasticsearchPersistentEntity
public SimpleElasticsearchPersistentEntity(TypeInformation<T> typeInformation, SimpleElasticsearchPersistentEntity.ContextConfiguration contextConfiguration)
-
-
Method Details
-
getIndexCoordinates
- Specified by:
getIndexCoordinatesin interfaceElasticsearchPersistentEntity<T>
-
getAliases
Description copied from interface:ElasticsearchPersistentEntityRetrieves the aliases associated with the current entity.- Specified by:
getAliasesin interfaceElasticsearchPersistentEntity<T>- Returns:
- Returns a set of aliases of the
PersistentEntity.
-
getIndexStoreType
- Specified by:
getIndexStoreTypein interfaceElasticsearchPersistentEntity<T>
-
getShards
public short getShards()- Specified by:
getShardsin interfaceElasticsearchPersistentEntity<T>
-
getReplicas
public short getReplicas()- Specified by:
getReplicasin interfaceElasticsearchPersistentEntity<T>
-
isUseServerConfiguration
public boolean isUseServerConfiguration()- Specified by:
isUseServerConfigurationin interfaceElasticsearchPersistentEntity<T>
-
getRefreshInterval
- Specified by:
getRefreshIntervalin interfaceElasticsearchPersistentEntity<T>
-
getVersionType
- Specified by:
getVersionTypein interfaceElasticsearchPersistentEntity<T>
-
isCreateIndexAndMapping
public boolean isCreateIndexAndMapping()- Specified by:
isCreateIndexAndMappingin interfaceElasticsearchPersistentEntity<T>
-
isAlwaysWriteMapping
public boolean isAlwaysWriteMapping()- Specified by:
isAlwaysWriteMappingin interfaceElasticsearchPersistentEntity<T>- Returns:
- if the mapping should be written to the index on repository bootstrap even if the index already exists.
-
getFieldNamingStrategy
- Specified by:
getFieldNamingStrategyin interfaceElasticsearchPersistentEntity<T>- Returns:
- the
FieldNamingStrategyfor the entity
-
writeTypeHints
public boolean writeTypeHints()- Specified by:
writeTypeHintsin interfaceElasticsearchPersistentEntity<T>- Returns:
- true if type hints on this entity should be written.
-
storeIdInSource
public boolean storeIdInSource()- Specified by:
storeIdInSourcein interfaceElasticsearchPersistentEntity<T>- Returns:
- the storeIdInSource value from the document annotation
-
storeVersionInSource
public boolean storeVersionInSource()- Specified by:
storeVersionInSourcein interfaceElasticsearchPersistentEntity<T>- Returns:
- the storeVersionInSource value from the document annotation.
-
addPersistentProperty
- Specified by:
addPersistentPropertyin interfaceMutablePersistentEntity<T,ElasticsearchPersistentProperty> - Overrides:
addPersistentPropertyin classBasicPersistentEntity<T,ElasticsearchPersistentProperty>
-
getPersistentPropertyWithFieldName
@Nullable public ElasticsearchPersistentProperty getPersistentPropertyWithFieldName(String fieldName) Description copied from interface:ElasticsearchPersistentEntityreturns theElasticsearchPersistentPropertywith the given fieldName (can be set by theField) annotation.- Specified by:
getPersistentPropertyWithFieldNamein interfaceElasticsearchPersistentEntity<T>- Parameters:
fieldName- to field name for the search, must not be null- Returns:
- the found property, otherwise null
-
hasSeqNoPrimaryTermProperty
public boolean hasSeqNoPrimaryTermProperty()Description copied from interface:ElasticsearchPersistentEntityReturns whether theElasticsearchPersistentEntityhas aSeqNoPrimaryTermproperty. If this call returns true,ElasticsearchPersistentEntity.getSeqNoPrimaryTermProperty()will return a non-null value.- Specified by:
hasSeqNoPrimaryTermPropertyin interfaceElasticsearchPersistentEntity<T>- Returns:
- false when
ElasticsearchPersistentEntitydoes not define a SeqNoPrimaryTerm property.
-
hasJoinFieldProperty
public boolean hasJoinFieldProperty()Description copied from interface:ElasticsearchPersistentEntityReturns whether theElasticsearchPersistentEntityhas aJoinFieldproperty. If this call returns true,ElasticsearchPersistentEntity.getJoinFieldProperty()will return a non-null value.- Specified by:
hasJoinFieldPropertyin interfaceElasticsearchPersistentEntity<T>- Returns:
- false when
ElasticsearchPersistentEntitydoes not define a JoinField property.
-
getSeqNoPrimaryTermProperty
Description copied from interface:ElasticsearchPersistentEntityReturns theSeqNoPrimaryTermproperty of theElasticsearchPersistentEntity. Can be null in case no such property is available on the entity.- Specified by:
getSeqNoPrimaryTermPropertyin interfaceElasticsearchPersistentEntity<T>- Returns:
- the
SeqNoPrimaryTermElasticsearchPersistentPropertyof thePersistentEntityor null if not defined.
-
getJoinFieldProperty
Description copied from interface:ElasticsearchPersistentEntityReturns theJoinFieldproperty of theElasticsearchPersistentEntity. Can be null in case no such property is available on the entity.- Specified by:
getJoinFieldPropertyin interfaceElasticsearchPersistentEntity<T>- Returns:
- the
JoinFieldElasticsearchPersistentPropertyof thePersistentEntityor null if not defined.
-
getIndexedIndexNameProperty
- Specified by:
getIndexedIndexNamePropertyin interfaceElasticsearchPersistentEntity<T>- Returns:
- the property annotated with
IndexedIndexNameif it exists, otherwise null
-
resolveRouting
Description copied from interface:ElasticsearchPersistentEntityResolves the routing for a bean.- Specified by:
resolveRoutingin interfaceElasticsearchPersistentEntity<T>- Parameters:
bean- the bean to resolve the routing for- Returns:
- routing value, may be null
-
settingPath
- Specified by:
settingPathin interfaceElasticsearchPersistentEntity<T>
-
getDefaultSettings
Description copied from interface:ElasticsearchPersistentEntityreturns the default settings for an index.- Specified by:
getDefaultSettingsin interfaceElasticsearchPersistentEntity<T>- Returns:
- settings
-
dynamic
- Specified by:
dynamicin interfaceElasticsearchPersistentEntity<T>- Returns:
- the
dynamicmapping parameter value.
-