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>
,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 class
Configuration settings passed in from the creatingSimpleElasticsearchMappingContext
. -
Constructor Summary
ConstructorsConstructorDescriptionSimpleElasticsearchPersistentEntity
(TypeInformation<T> typeInformation, SimpleElasticsearchPersistentEntity.ContextConfiguration contextConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dynamic()
returns the default settings for an index.Returns theJoinField
property of theElasticsearchPersistentEntity
.getPersistentPropertyWithFieldName
(String fieldName) returns theElasticsearchPersistentProperty
with the given fieldName (may be set by theField
annotation.short
Returns theSeqNoPrimaryTerm
property of theElasticsearchPersistentEntity
.short
boolean
Returns whether theElasticsearchPersistentEntity
has aJoinField
property.boolean
Returns whether theElasticsearchPersistentEntity
has aSeqNoPrimaryTerm
property.boolean
boolean
resolveRouting
(T bean) Resolves the routing for a bean.boolean
boolean
boolean
Methods 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, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, iterator, requiresPropertyPopulation, returnPropertyIfBetterIdPropertyCandidateOrNull, setEvaluationContextProvider, setPersistentPropertyAccessorFactory, verify
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity
getRequiredSeqNoPrimaryTermProperty, getVersionProperty
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods 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:
getIndexCoordinates
in interfaceElasticsearchPersistentEntity<T>
-
getIndexStoreType
- Specified by:
getIndexStoreType
in interfaceElasticsearchPersistentEntity<T>
-
getShards
public short getShards()- Specified by:
getShards
in interfaceElasticsearchPersistentEntity<T>
-
getReplicas
public short getReplicas()- Specified by:
getReplicas
in interfaceElasticsearchPersistentEntity<T>
-
isUseServerConfiguration
public boolean isUseServerConfiguration()- Specified by:
isUseServerConfiguration
in interfaceElasticsearchPersistentEntity<T>
-
getRefreshInterval
- Specified by:
getRefreshInterval
in interfaceElasticsearchPersistentEntity<T>
-
getVersionType
- Specified by:
getVersionType
in interfaceElasticsearchPersistentEntity<T>
-
isCreateIndexAndMapping
public boolean isCreateIndexAndMapping()- Specified by:
isCreateIndexAndMapping
in interfaceElasticsearchPersistentEntity<T>
-
getFieldNamingStrategy
- Specified by:
getFieldNamingStrategy
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- the
FieldNamingStrategy
for the entity
-
writeTypeHints
public boolean writeTypeHints()- Specified by:
writeTypeHints
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- true if type hints on this entity should be written.
-
storeIdInSource
public boolean storeIdInSource()- Specified by:
storeIdInSource
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- the storeIdInSource value from the document annotation
-
storeVersionInSource
public boolean storeVersionInSource()- Specified by:
storeVersionInSource
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- the storeVersionInSource value from the document annotation.
-
addPersistentProperty
- Specified by:
addPersistentProperty
in interfaceMutablePersistentEntity<T,
ElasticsearchPersistentProperty> - Overrides:
addPersistentProperty
in classBasicPersistentEntity<T,
ElasticsearchPersistentProperty>
-
getPersistentPropertyWithFieldName
@Nullable public ElasticsearchPersistentProperty getPersistentPropertyWithFieldName(String fieldName) Description copied from interface:ElasticsearchPersistentEntity
returns theElasticsearchPersistentProperty
with the given fieldName (may be set by theField
annotation.- Specified by:
getPersistentPropertyWithFieldName
in 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:ElasticsearchPersistentEntity
Returns whether theElasticsearchPersistentEntity
has aSeqNoPrimaryTerm
property. If this call returns true,ElasticsearchPersistentEntity.getSeqNoPrimaryTermProperty()
will return a non-null value.- Specified by:
hasSeqNoPrimaryTermProperty
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- false when
ElasticsearchPersistentEntity
does not define a SeqNoPrimaryTerm property.
-
hasJoinFieldProperty
public boolean hasJoinFieldProperty()Description copied from interface:ElasticsearchPersistentEntity
Returns whether theElasticsearchPersistentEntity
has aJoinField
property. If this call returns true,ElasticsearchPersistentEntity.getJoinFieldProperty()
will return a non-null value.- Specified by:
hasJoinFieldProperty
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- false when
ElasticsearchPersistentEntity
does not define a JoinField property.
-
getSeqNoPrimaryTermProperty
Description copied from interface:ElasticsearchPersistentEntity
Returns theSeqNoPrimaryTerm
property of theElasticsearchPersistentEntity
. Can be null in case no such property is available on the entity.- Specified by:
getSeqNoPrimaryTermProperty
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- the
SeqNoPrimaryTerm
ElasticsearchPersistentProperty
of thePersistentEntity
or null if not defined.
-
getJoinFieldProperty
Description copied from interface:ElasticsearchPersistentEntity
Returns theJoinField
property of theElasticsearchPersistentEntity
. Can be null in case no such property is available on the entity.- Specified by:
getJoinFieldProperty
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- the
JoinField
ElasticsearchPersistentProperty
of thePersistentEntity
or null if not defined.
-
getIndexedIndexNameProperty
- Specified by:
getIndexedIndexNameProperty
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- the property annotated with
IndexedIndexName
if it exists, otherwise null
-
resolveRouting
Description copied from interface:ElasticsearchPersistentEntity
Resolves the routing for a bean.- Specified by:
resolveRouting
in interfaceElasticsearchPersistentEntity<T>
- Parameters:
bean
- the bean to resolve the routing for- Returns:
- routing value, may be null
-
settingPath
- Specified by:
settingPath
in interfaceElasticsearchPersistentEntity<T>
-
getDefaultSettings
Description copied from interface:ElasticsearchPersistentEntity
returns the default settings for an index.- Specified by:
getDefaultSettings
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- settings
-
dynamic
- Specified by:
dynamic
in interfaceElasticsearchPersistentEntity<T>
- Returns:
- the
dynamic
mapping parameter value.
-