Spring Data Couchbase

org.springframework.data.couchbase.core.mapping
Class CouchbaseMappingContext

java.lang.Object
  extended by org.springframework.data.mapping.context.AbstractMappingContext<BasicCouchbasePersistentEntity<?>,CouchbasePersistentProperty>
      extended by org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext
All Implemented Interfaces:
Aware, InitializingBean, ApplicationContextAware, ApplicationEventPublisherAware, MappingContext<BasicCouchbasePersistentEntity<?>,CouchbasePersistentProperty>

public class CouchbaseMappingContext
extends AbstractMappingContext<BasicCouchbasePersistentEntity<?>,CouchbasePersistentProperty>
implements ApplicationContextAware

Default implementation of a MappingContext for Couchbase using BasicCouchbasePersistentEntity and BasicCouchbasePersistentProperty as primary abstractions.

Author:
Michael Nitschinger

Constructor Summary
CouchbaseMappingContext()
           
 
Method Summary
protected
<T> BasicCouchbasePersistentEntity<?>
createPersistentEntity(TypeInformation<T> typeInformation)
          Creates a concrete entity based out of the type information passed.
protected  CouchbasePersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor, BasicCouchbasePersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder)
          Creates a concrete property based on the field information and entity.
 void setApplicationContext(ApplicationContext applicationContext)
          Sets (or overrides) the current application context.
 void setFieldNamingStrategy(FieldNamingStrategy fieldNamingStrategy)
          Configures the FieldNamingStrategy to be used to determine the field name if no manual mapping is applied.
 
Methods inherited from class org.springframework.data.mapping.context.AbstractMappingContext
addPersistentEntity, addPersistentEntity, afterPropertiesSet, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, initialize, setApplicationEventPublisher, setInitialEntitySet, setSimpleTypeHolder, setStrict, shouldCreatePersistentEntityFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CouchbaseMappingContext

public CouchbaseMappingContext()
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.

createPersistentEntity

protected <T> BasicCouchbasePersistentEntity<?> createPersistentEntity(TypeInformation<T> typeInformation)
Creates a concrete entity based out of the type information passed.

Specified by:
createPersistentEntity in class AbstractMappingContext<BasicCouchbasePersistentEntity<?>,CouchbasePersistentProperty>
Type Parameters:
T - the type for the corresponding type information.
Parameters:
typeInformation - type information of the entity to create.
Returns:
the constructed entity.

createPersistentProperty

protected CouchbasePersistentProperty createPersistentProperty(Field field,
                                                               PropertyDescriptor descriptor,
                                                               BasicCouchbasePersistentEntity<?> owner,
                                                               SimpleTypeHolder simpleTypeHolder)
Creates a concrete property based on the field information and entity.

Specified by:
createPersistentProperty in class AbstractMappingContext<BasicCouchbasePersistentEntity<?>,CouchbasePersistentProperty>
Parameters:
field - the reflection on the field to be used as a property.
descriptor - the property descriptor.
owner - the entity which owns the property.
simpleTypeHolder - the type holder.
Returns:
the constructed property.

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Sets (or overrides) the current application context.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the application context to be assigned.
Throws:
BeansException - if the context can not be set properly.

Spring Data Couchbase

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.