Spring Data Document

org.springframework.data.mongodb.core.convert
Interface MongoWriter<T>

Type Parameters:
T - the type of the object to convert to a DBObject
All Known Subinterfaces:
MongoConverter
All Known Implementing Classes:
AbstractMongoConverter, MappingMongoConverter

public interface MongoWriter<T>

A MongoWriter is responsible for converting an object of type T to the native MongoDB representation DBObject.

Author:
Mark Pollack, Thomas Risberg, Oliver Gierke

Method Summary
 Object convertToMongoType(Object obj)
          Converts the given object into one Mongo will be able to store natively.
 void write(T t, DBObject dbo)
          Write the given object of type T to the native MongoDB object representation DBObject.
 

Method Detail

write

void write(T t,
           DBObject dbo)
Write the given object of type T to the native MongoDB object representation DBObject.

Parameters:
t - The object to convert to a DBObject
dbo - The DBObject to use for writing.

convertToMongoType

Object convertToMongoType(Object obj)
Converts the given object into one Mongo will be able to store natively. If the given object can already be stored as is, no conversion will happen.

Parameters:
obj -
Returns:

Spring Data Document

Copyright © 2011. All Rights Reserved.