public class UpdateMapper extends QueryMapper
QueryMapper that retains type information on the mongo types.QueryMapper.AssociationConverter, QueryMapper.Field, QueryMapper.MetadataBackedField| Constructor and Description |
|---|
UpdateMapper(MongoConverter converter)
Creates a new
UpdateMapper using the given MongoConverter. |
| Modifier and Type | Method and Description |
|---|---|
protected QueryMapper.Field |
createPropertyField(MongoPersistentEntity<?> entity,
String key,
MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext) |
protected Object |
delegateConvertToMongoType(Object source,
MongoPersistentEntity<?> entity)
Converts the given source object to a mongo type retaining the original type information of the source type on the
mongo type.
|
protected Map.Entry<String,Object> |
getMappedObjectForField(QueryMapper.Field field,
Object rawValue)
Extracts the mapped object value for given field out of rawValue taking nested
Keywords into account |
protected boolean |
isAssociationConversionNecessary(QueryMapper.Field documentField,
Object value)
Returns whether the given
QueryMapper.Field represents an association reference that together with the given value
requires conversion to a DBRef object. |
convertAssociation, convertAssociation, convertId, convertSimpleOrDBObject, createMapEntry, getMappedFields, getMappedKeyword, getMappedKeyword, getMappedObject, getMappedSort, getMappedValue, isDBObject, isKeyword, isNestedKeywordpublic UpdateMapper(MongoConverter converter)
UpdateMapper using the given MongoConverter.converter - must not be null.protected Object delegateConvertToMongoType(Object source, MongoPersistentEntity<?> entity)
delegateConvertToMongoType in class QueryMapperQueryMapper.delegateConvertToMongoType(java.lang.Object,
org.springframework.data.mongodb.core.mapping.MongoPersistentEntity)protected Map.Entry<String,Object> getMappedObjectForField(QueryMapper.Field field, Object rawValue)
QueryMapperKeywords into accountgetMappedObjectForField in class QueryMapperprotected boolean isAssociationConversionNecessary(QueryMapper.Field documentField, Object value)
QueryMapperQueryMapper.Field represents an association reference that together with the given value
requires conversion to a DBRef object. We check whether the
type of the given value is compatible with the type of the given document field in order to deal with potential
query field exclusions, since MongoDB uses the int 0 as an indicator for an excluded field.isAssociationConversionNecessary in class QueryMapperdocumentField - must not be null.protected QueryMapper.Field createPropertyField(MongoPersistentEntity<?> entity, String key, MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext)
createPropertyField in class QueryMapperCopyright © 2011-2014–2015 Pivotal Software, Inc.. All rights reserved.