JavaScript is disabled on your browser.
Nested Class Summary
Nested Classes
Modifier and Type
Class and Description
protected static class
QueryMapper.AssociationConverter
Converter to skip all properties after an association property was rendered.
protected static class
QueryMapper.Field
Value object to represent a field and its meta-information.
protected static class
QueryMapper.MetadataBackedField
Extension of DocumentField
to be backed with mapping metadata.
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
protected Object
convertAssociation (Object source,
MongoPersistentProperty property)
Converts the given source assuming it's actually an association to another object.
protected Object
convertAssociation (Object source,
QueryMapper.Field field)
Object
convertId (Object id)
Converts the given raw id value into either
ObjectId
or
String
.
protected Object
convertSimpleOrDocument (Object source,
MongoPersistentEntity <?> entity)
Retriggers mapping if the given source is a Document
or simply invokes the
protected Map.Entry <String ,Object >
createMapEntry (QueryMapper.Field field,
Object value)
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 with the type information of the original source type omitted.
org.bson.Document
getMappedFields (org.bson.Document fieldsObject,
MongoPersistentEntity <?> entity)
protected org.bson.Document
getMappedKeyword (QueryMapper.Field property,
org.springframework.data.mongodb.core.convert.QueryMapper.Keyword keyword)
Returns the mapped keyword considered defining a criteria for the given property.
protected org.bson.Document
getMappedKeyword (org.springframework.data.mongodb.core.convert.QueryMapper.Keyword keyword,
MongoPersistentEntity <?> entity)
Returns the given Document
representing a keyword by mapping the keyword's value.
org.bson.Document
getMappedObject (org.bson.conversions.Bson query,
MongoPersistentEntity <?> entity)
Replaces the property keys used in the given
Document
with the appropriate keys by using the
PersistentEntity
metadata.
org.bson.Document
getMappedObject (org.bson.conversions.Bson query,
Optional <? extends MongoPersistentEntity <?>> entity)
protected Map.Entry <String ,Object >
getMappedObjectForField (QueryMapper.Field field,
Object rawValue)
Extracts the mapped object value for given field out of rawValue taking nested Keyword
s into account
org.bson.Document
getMappedSort (org.bson.Document sortObject,
MongoPersistentEntity <?> entity)
protected Object
getMappedValue (QueryMapper.Field documentField,
Object value)
MappingContext <? extends MongoPersistentEntity <?>,MongoPersistentProperty >
getMappingContext ()
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.
protected boolean
isDBObject (Object value)
Checks whether the given value is a DBObject
.
protected boolean
isDocument (Object value)
Checks whether the given value is a Document
.
protected boolean
isKeyword (String candidate)
Returns whether the given
String
is a MongoDB keyword.
protected boolean
isNestedKeyword (Object candidate)
Returns whether the given
Object
is a keyword, i.e. if it's a
Document
with a keyword key.
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Method Detail
getMappedObjectForField
protected Map.Entry <String ,Object > getMappedObjectForField(QueryMapper.Field field,
Object rawValue)
Extracts the mapped object value for given field out of rawValue taking nested Keyword
s into account
Parameters:
field
-
rawValue
-
Returns:
getMappedKeyword
protected org.bson.Document getMappedKeyword(org.springframework.data.mongodb.core.convert.QueryMapper.Keyword keyword,
@Nullable
MongoPersistentEntity <?> entity)
Returns the given Document
representing a keyword by mapping the keyword's value.
Parameters:
keyword
- the Document
representing a keyword (e.g. $ne : …
)
entity
-
Returns:
getMappedKeyword
protected org.bson.Document getMappedKeyword(QueryMapper.Field property,
org.springframework.data.mongodb.core.convert.QueryMapper.Keyword keyword)
Returns the mapped keyword considered defining a criteria for the given property.
Parameters:
property
-
keyword
-
Returns:
delegateConvertToMongoType
@Nullable
protected Object delegateConvertToMongoType(Object source,
@Nullable
MongoPersistentEntity <?> entity)
Converts the given source Object to a mongo type with the type information of the original source type omitted.
Subclasses may overwrite this method to retain the type information of the source type on the resulting mongo type.
Parameters:
source
-
entity
-
Returns:
the converted mongo type or null if source is null