public class BasicMongoPersistentEntity<T> extends BasicPersistentEntity<T,MongoPersistentProperty> implements MongoPersistentEntity<T>, 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. |
hasIdProperty, hasVersionPropertyhasIdProperty, hasVersionProperty| Constructor and Description |
|---|
BasicMongoPersistentEntity(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(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(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(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic 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 MutablePersistentEntity<T,MongoPersistentProperty>verify 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–2018 Pivotal Software, Inc.. All rights reserved.