Spring Data MongoDB - Core

org.springframework.data.mongodb.core.mapping
Class MongoMappingContext

java.lang.Object
  extended by org.springframework.data.mapping.context.AbstractMappingContext<BasicMongoPersistentEntity<?>,MongoPersistentProperty>
      extended by org.springframework.data.mongodb.core.mapping.MongoMappingContext
All Implemented Interfaces:
Aware, InitializingBean, ApplicationContextAware, ApplicationEventPublisherAware, MappingContext<BasicMongoPersistentEntity<?>,MongoPersistentProperty>

public class MongoMappingContext
extends AbstractMappingContext<BasicMongoPersistentEntity<?>,MongoPersistentProperty>
implements ApplicationContextAware

Default implementation of a MappingContext for MongoDB using BasicMongoPersistentEntity and BasicMongoPersistentProperty as primary abstractions.

Author:
Jon Brisbin, Oliver Gierke

Constructor Summary
MongoMappingContext()
          Creates a new MongoMappingContext.
 
Method Summary
protected
<T> BasicMongoPersistentEntity<T>
createPersistentEntity(TypeInformation<T> typeInformation)
           
 MongoPersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor, BasicMongoPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder)
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setFieldNamingStrategy(FieldNamingStrategy fieldNamingStrategy)
          Configures the FieldNamingStrategy to be used to determine the field name if no manual mapping is applied.
protected  boolean shouldCreatePersistentEntityFor(TypeInformation<?> type)
           
 
Methods inherited from class org.springframework.data.mapping.context.AbstractMappingContext
addPersistentEntity, addPersistentEntity, afterPropertiesSet, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, initialize, setApplicationEventPublisher, setInitialEntitySet, setSimpleTypeHolder, setStrict
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MongoMappingContext

public MongoMappingContext()
Creates a new MongoMappingContext.

Method Detail

setFieldNamingStrategy

public void setFieldNamingStrategy(FieldNamingStrategy fieldNamingStrategy)
Configures the FieldNamingStrategy to be used to determine the field name if no manual mapping is applied. Defaults to a strategy using the plain property name.

Parameters:
fieldNamingStrategy - the FieldNamingStrategy to be used to determine the field name if no manual mapping is applied.

shouldCreatePersistentEntityFor

protected boolean shouldCreatePersistentEntityFor(TypeInformation<?> type)
Overrides:
shouldCreatePersistentEntityFor in class AbstractMappingContext<BasicMongoPersistentEntity<?>,MongoPersistentProperty>

createPersistentProperty

public MongoPersistentProperty createPersistentProperty(Field field,
                                                        PropertyDescriptor descriptor,
                                                        BasicMongoPersistentEntity<?> owner,
                                                        SimpleTypeHolder simpleTypeHolder)
Specified by:
createPersistentProperty in class AbstractMappingContext<BasicMongoPersistentEntity<?>,MongoPersistentProperty>

createPersistentEntity

protected <T> BasicMongoPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation)
Specified by:
createPersistentEntity in class AbstractMappingContext<BasicMongoPersistentEntity<?>,MongoPersistentProperty>

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

Spring Data MongoDB - Core

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.