Spring Data MongoDB

org.springframework.data.mongodb.core.convert
Interface MongoTypeMapper

All Superinterfaces:
TypeMapper<com.mongodb.DBObject>
All Known Implementing Classes:
DefaultMongoTypeMapper

public interface MongoTypeMapper
extends TypeMapper<com.mongodb.DBObject>

Mongo-specific TypeMapper exposing that DBObjects might contain a type key.

Author:
Oliver Gierke

Method Summary
 boolean isTypeKey(String key)
          Returns whether the given key is the type key.
 void writeTypeRestrictions(com.mongodb.DBObject result, Set<Class<?>> restrictedTypes)
          Writes type restrictions to the given DBObject.
 
Methods inherited from interface org.springframework.data.convert.TypeMapper
readType, readType, writeType, writeType
 

Method Detail

isTypeKey

boolean isTypeKey(String key)
Returns whether the given key is the type key.

Returns:

writeTypeRestrictions

void writeTypeRestrictions(com.mongodb.DBObject result,
                           Set<Class<?>> restrictedTypes)
Writes type restrictions to the given DBObject. This usually results in an $in-clause to be generated that restricts the type-key (e.g. _class) to be in the set of type aliases for the given restrictedTypes.

Parameters:
result - must not be null
restrictedTypes - must not be null

Spring Data MongoDB

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