|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mongodb.core.convert.QueryMapper
public class QueryMapper
A helper class to encapsulate any modifications of a Query object before it gets submitted to the database.
| Nested Class Summary | |
|---|---|
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. |
| Constructor Summary | |
|---|---|
QueryMapper(MongoConverter converter)
Creates a new QueryMapper with the given MongoConverter. |
|
| Method Summary | |
|---|---|
Object |
convertId(Object id)
Converts the given raw id value into either ObjectId or String. |
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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryMapper(MongoConverter converter)
QueryMapper with the given MongoConverter.
converter - must not be null.| Method Detail |
|---|
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 QueryMapper.Field createPropertyField(MongoPersistentEntity<?> entity,
String key,
MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext)
entity - key - mappingContext -
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 -
protected boolean isKeyword(String candidate)
String is a MongoDB keyword. The default implementation will check against the
set of registered keywords returned by #getKeywords().
candidate -
|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||