Spring Data MongoDB

org.springframework.data.mongodb.core.convert
Class QueryMapper

java.lang.Object
  extended by org.springframework.data.mongodb.core.convert.QueryMapper

public class QueryMapper
extends Object

A helper class to encapsulate any modifications of a Query object before it gets submitted to the database.

Author:
Jon Brisbin, Oliver Gierke

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.
 com.mongodb.DBObject getMappedKeyword(org.springframework.data.mongodb.core.convert.QueryMapper.Keyword keyword, MongoPersistentProperty property)
          Returns the mapped keyword considered defining a criteria for the given property.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryMapper

public QueryMapper(MongoConverter converter)
Creates a new QueryMapper with the given MongoConverter.

Parameters:
converter - must not be null.
Method Detail

getMappedObject

public 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.

Parameters:
query - must not be null.
entity - can be null.
Returns:

getMappedKeyword

public com.mongodb.DBObject getMappedKeyword(org.springframework.data.mongodb.core.convert.QueryMapper.Keyword keyword,
                                             MongoPersistentProperty property)
Returns the mapped keyword considered defining a criteria for the given property.

Parameters:
keyword -
property -
Returns:

convertId

public Object convertId(Object id)
Converts the given raw id value into either ObjectId or String.

Parameters:
id -
Returns:

Spring Data MongoDB

Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.