public class MongoMappingContext extends org.springframework.data.mapping.context.AbstractMappingContext<MongoPersistentEntity<?>,MongoPersistentProperty> implements ApplicationContextAware
MappingContext
for MongoDB using BasicMongoPersistentEntity
and
BasicMongoPersistentProperty
as primary abstractions.Constructor and Description |
---|
MongoMappingContext()
Creates a new
MongoMappingContext . |
Modifier and Type | Method and Description |
---|---|
protected <T> BasicMongoPersistentEntity<T> |
createPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation) |
MongoPersistentProperty |
createPersistentProperty(org.springframework.data.mapping.model.Property property,
MongoPersistentEntity<?> owner,
org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder) |
MongoPersistentEntity<?> |
getPersistentEntity(MongoPersistentProperty persistentProperty) |
boolean |
isAutoIndexCreation()
Returns whether auto-index creation is enabled or disabled.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setAutoIndexCreation(boolean autoCreateIndexes)
Enables/disables auto-index creation.
|
void |
setFieldNamingStrategy(org.springframework.data.mapping.model.FieldNamingStrategy fieldNamingStrategy)
Configures the
FieldNamingStrategy to be used to determine the field name if no manual mapping is applied. |
protected boolean |
shouldCreatePersistentEntityFor(org.springframework.data.util.TypeInformation<?> type) |
addPersistentEntity, addPersistentEntity, afterPropertiesSet, doFindPersistentPropertyPaths, findPersistentPropertyPaths, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, initialize, setApplicationEventPublisher, setInitialEntitySet, setSimpleTypeHolder, setStrict
public MongoMappingContext()
MongoMappingContext
.public void setFieldNamingStrategy(@Nullable org.springframework.data.mapping.model.FieldNamingStrategy fieldNamingStrategy)
FieldNamingStrategy
to be used to determine the field name if no manual mapping is applied.
Defaults to a strategy using the plain property name.fieldNamingStrategy
- the FieldNamingStrategy
to be used to determine the field name if no manual
mapping is applied.protected boolean shouldCreatePersistentEntityFor(org.springframework.data.util.TypeInformation<?> type)
shouldCreatePersistentEntityFor
in class org.springframework.data.mapping.context.AbstractMappingContext<MongoPersistentEntity<?>,MongoPersistentProperty>
public MongoPersistentProperty createPersistentProperty(org.springframework.data.mapping.model.Property property, MongoPersistentEntity<?> owner, org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder)
createPersistentProperty
in class org.springframework.data.mapping.context.AbstractMappingContext<MongoPersistentEntity<?>,MongoPersistentProperty>
protected <T> BasicMongoPersistentEntity<T> createPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
createPersistentEntity
in class org.springframework.data.mapping.context.AbstractMappingContext<MongoPersistentEntity<?>,MongoPersistentProperty>
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
setApplicationContext
in class org.springframework.data.mapping.context.AbstractMappingContext<MongoPersistentEntity<?>,MongoPersistentProperty>
BeansException
public boolean isAutoIndexCreation()
Indexed
public void setAutoIndexCreation(boolean autoCreateIndexes)
autoCreateIndexes
- set to true to enable auto-index creation.Indexed
@Nullable public MongoPersistentEntity<?> getPersistentEntity(MongoPersistentProperty persistentProperty)
getPersistentEntity
in interface org.springframework.data.mapping.context.MappingContext<MongoPersistentEntity<?>,MongoPersistentProperty>
getPersistentEntity
in class org.springframework.data.mapping.context.AbstractMappingContext<MongoPersistentEntity<?>,MongoPersistentProperty>
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.