org.springframework.data.mongodb.core.convert
Class UpdateMapper
java.lang.Object
org.springframework.data.mongodb.core.convert.QueryMapper
org.springframework.data.mongodb.core.convert.UpdateMapper
public class UpdateMapper
- extends QueryMapper
A subclass of QueryMapper that retains type information on the mongo types.
- Author:
- Thomas Darimont, Oliver Gierke, Christoph Strobl
| Methods inherited from class org.springframework.data.mongodb.core.convert.QueryMapper |
convertAssociation, convertAssociation, convertId, convertSimpleOrDBObject, createMapEntry, getMappedKeyword, getMappedKeyword, getMappedObject, getMappedValue, isDBObject, isKeyword, isNestedKeyword |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UpdateMapper
public UpdateMapper(MongoConverter converter)
- Creates a new
UpdateMapper using the given MongoConverter.
- Parameters:
converter - must not be null.
delegateConvertToMongoType
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.
- Overrides:
delegateConvertToMongoType in class QueryMapper
- Returns:
- the converted mongo type or null if source is null
- See Also:
QueryMapper.delegateConvertToMongoType(java.lang.Object,
org.springframework.data.mongodb.core.mapping.MongoPersistentEntity)
getMappedObjectForField
protected Map.Entry<String,Object> getMappedObjectForField(QueryMapper.Field field,
Object rawValue)
- Description copied from class:
QueryMapper
- Extracts the mapped object value for given field out of rawValue taking nested
Keywords into account
- Overrides:
getMappedObjectForField in class QueryMapper
- Returns:
isAssociationConversionNecessary
protected boolean isAssociationConversionNecessary(QueryMapper.Field documentField,
Object value)
- Description copied from class:
QueryMapper
- Returns whether the given
QueryMapper.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.
- Overrides:
isAssociationConversionNecessary in class QueryMapper
- Parameters:
documentField - must not be null.
- Returns:
createPropertyField
protected QueryMapper.Field createPropertyField(MongoPersistentEntity<?> entity,
String key,
MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext)
- Overrides:
createPropertyField in class QueryMapper
- Returns:
Copyright © 2011-2014-2014 Pivotal Software, Inc.. All Rights Reserved.