public class QueryMapper extends Object
Constructor and Description |
---|
QueryMapper(MongoConverter converter)
Creates a new
QueryMapper with the given MongoConverter . |
Modifier and Type | Method and Description |
---|---|
Object |
convertId(Object id)
Converts the given raw id value into either
ObjectId or String . |
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.
|
com.mongodb.DBObject |
getMappedObject(com.mongodb.DBObject query,
MongoPersistentEntity<?> entity)
Replaces the property keys used in the given
DBObject with the appropriate keys by using the
PersistentEntity metadata. |
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 DBObject with a keyword key. |
public QueryMapper(MongoConverter converter)
QueryMapper
with the given MongoConverter
.converter
- must not be null.public com.mongodb.DBObject getMappedObject(com.mongodb.DBObject query, MongoPersistentEntity<?> entity)
DBObject
with the appropriate keys by using the
PersistentEntity
metadata.query
- must not be null.entity
- can be null.protected Object delegateConvertToMongoType(Object source, MongoPersistentEntity<?> entity)
source
- entity
- public Object convertId(Object id)
ObjectId
or String
.id
- protected boolean isNestedKeyword(Object candidate)
Object
is a keyword, i.e. if it's a DBObject
with a keyword key.candidate
- Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.