public class BasicMongoPersistentEntity<T> extends BasicPersistentEntity<T,MongoPersistentProperty> implements MongoPersistentEntity<T>
MongoPersistentEntity implementation that adds Mongo specific meta-data such as the
collection name and the like.| Constructor and Description |
|---|
BasicMongoPersistentEntity(TypeInformation<T> typeInformation)
Creates a new
BasicMongoPersistentEntity with the given TypeInformation. |
| Modifier and Type | Method and Description |
|---|---|
Collation |
getCollation()
Returns the collation of the entity evaluating a potential SpEL expression within the current context.
|
String |
getCollection()
Returns the collection the entity shall be persisted to.
|
EvaluationContext |
getEvaluationContext(Object rootObject) |
String |
getLanguage()
Returns the default language to be used for this entity.
|
ShardKey |
getShardKey()
Get the entities shard key if defined.
|
MongoPersistentProperty |
getTextScoreProperty()
Returns the property holding text score value.
|
boolean |
hasTextScoreProperty()
Returns whether the entity has a
TextScore property. |
protected MongoPersistentProperty |
returnPropertyIfBetterIdPropertyCandidateOrNull(MongoPersistentProperty property)
As a general note: An implicit id property has a name that matches "id" or "_id".
|
void |
verify() |
addAssociation, addPersistentProperty, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getEvaluationContext, getFallbackIsNewStrategy, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, iterator, requiresPropertyPopulation, setEvaluationContextProvider, setPersistentPropertyAccessorFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasCollation, isSharded, isUnwrappedaddAssociation, addPersistentProperty, setEvaluationContextProvider, setPersistentPropertyAccessorFactorydoWithAll, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulationforEach, iterator, spliteratorpublic BasicMongoPersistentEntity(TypeInformation<T> typeInformation)
BasicMongoPersistentEntity with the given TypeInformation. Will default the
collection name to the entities simple type name.typeInformation - must not be null.public String getCollection()
MongoPersistentEntitygetCollection in interface MongoPersistentEntity<T>public String getLanguage()
MongoPersistentEntitygetLanguage in interface MongoPersistentEntity<T>@Nullable public MongoPersistentProperty getTextScoreProperty()
MongoPersistentEntitygetTextScoreProperty in interface MongoPersistentEntity<T>MongoPersistentEntity.hasTextScoreProperty()public boolean hasTextScoreProperty()
MongoPersistentEntityTextScore property.hasTextScoreProperty in interface MongoPersistentEntity<T>TextScore is present.public Collation getCollation()
MongoPersistentEntitygetCollation in interface MongoPersistentEntity<T>public ShardKey getShardKey()
MongoPersistentEntitygetShardKey in interface MongoPersistentEntity<T>ShardKey.none() if not not set.public void verify()
verify in interface MutablePersistentEntity<T,MongoPersistentProperty>verify in class BasicPersistentEntity<T,MongoPersistentProperty>public EvaluationContext getEvaluationContext(Object rootObject)
getEvaluationContext in class BasicPersistentEntity<T,MongoPersistentProperty>protected MongoPersistentProperty returnPropertyIfBetterIdPropertyCandidateOrNull(MongoPersistentProperty property)
Id. The property id is updated according to the following rules: 1) An id
property which is defined explicitly takes precedence over an implicitly defined id property. 2) In case of any
ambiguity a @see MappingException is thrown.returnPropertyIfBetterIdPropertyCandidateOrNull in class BasicPersistentEntity<T,MongoPersistentProperty>property - - the new id property candidateCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.