public class BasicMongoPersistentEntity<T> extends org.springframework.data.mapping.model.BasicPersistentEntity<T,MongoPersistentProperty> implements MongoPersistentEntity<T>, org.springframework.context.ApplicationContextAware
MongoPersistentEntity implementation that adds Mongo specific meta-data such as the
collection name and the like.| Type | Property and Description |
|---|---|
boolean |
hasTextScore
Returns whether the entity has a
TextScore property. |
| Constructor and Description |
|---|
BasicMongoPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
Creates a new
BasicMongoPersistentEntity with the given TypeInformation. |
| Modifier and Type | Method and Description |
|---|---|
String |
getCollection()
Returns the collection the entity shall be persisted to.
|
String |
getLanguage()
Returns the default language to be used for this entity.
|
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 |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
verify() |
addAssociation, addPersistentProperty, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isConstructorArgument, isIdProperty, isVersionProperty, setPersistentPropertyAccessorFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isConstructorArgument, isIdProperty, isVersionPropertypublic boolean hasTextScoreProperty
hasTextScoreProperty in interface MongoPersistentEntity<T>TextScore is present.public BasicMongoPersistentEntity(org.springframework.data.util.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 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic String getCollection()
MongoPersistentEntitygetCollection in interface MongoPersistentEntity<T>public String getLanguage()
MongoPersistentEntitygetLanguage in interface MongoPersistentEntity<T>public MongoPersistentProperty getTextScoreProperty()
MongoPersistentEntitygetTextScoreProperty in interface MongoPersistentEntity<T>MongoPersistentEntity.hasTextScoreProperty()public boolean hasTextScoreProperty()
MongoPersistentEntityTextScore property.hasTextScoreProperty in interface MongoPersistentEntity<T>TextScore is present.public void verify()
verify in interface org.springframework.data.mapping.model.MutablePersistentEntity<T,MongoPersistentProperty>verify in class org.springframework.data.mapping.model.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 org.springframework.data.mapping.model.BasicPersistentEntity<T,MongoPersistentProperty>property - - the new id property candidateCopyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.