Spring Data Document

org.springframework.data.mongodb.core
Class QueryMapper

java.lang.Object
  extended by org.springframework.data.mongodb.core.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(ConversionService conversionService)
          Creates a new QueryMapper with the given ConversionService.
 
Method Summary
 Object convertId(Object id)
          Converts the given raw id value into either ObjectId or String.
 DBObject getMappedObject(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(ConversionService conversionService)
Creates a new QueryMapper with the given ConversionService.

Parameters:
conversionService - must not be null.
Method Detail

getMappedObject

public DBObject getMappedObject(DBObject query,
                                MongoPersistentEntity<?> entity)
Replaces the property keys used in the given DBObject with the appropriate keys by using the PersistentEntity metadata.

Parameters:
query -
entity -
Returns:

convertId

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

Parameters:
id -
Returns:

Spring Data Document

Copyright © 2011. All Rights Reserved.