org.springframework.data.mongodb.repository.query
Class ConvertingParameterAccessor

java.lang.Object
  extended by org.springframework.data.mongodb.repository.query.ConvertingParameterAccessor
All Implemented Interfaces:
Iterable<Object>, MongoParameterAccessor, org.springframework.data.repository.query.ParameterAccessor

public class ConvertingParameterAccessor
extends Object
implements MongoParameterAccessor

Custom ParameterAccessor that uses a MongoWriter to serialize parameters into Mongo format.

Author:
Oliver Gierke

Nested Class Summary
static interface ConvertingParameterAccessor.PotentiallyConvertingIterator
          Custom Iterator that adds a method to access elements in a converted manner.
 
Constructor Summary
ConvertingParameterAccessor(MongoWriter<?> writer, MongoParameterAccessor delegate)
          Creates a new ConvertingParameterAccessor with the given MongoWriter and delegate.
 
Method Summary
 Object getBindableValue(int index)
           
 Point getGeoNearLocation()
          Returns the Point to use for a geo-near query.
 Distance getMaxDistance()
          Returns a Distance to be applied to Mongo geo queries.
 org.springframework.data.domain.Pageable getPageable()
           
 org.springframework.data.domain.Sort getSort()
           
 ConvertingParameterAccessor.PotentiallyConvertingIterator iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvertingParameterAccessor

public ConvertingParameterAccessor(MongoWriter<?> writer,
                                   MongoParameterAccessor delegate)
Creates a new ConvertingParameterAccessor with the given MongoWriter and delegate.

Parameters:
writer - must not be null.
delegate - must not be null.
Method Detail

iterator

public ConvertingParameterAccessor.PotentiallyConvertingIterator iterator()
Specified by:
iterator in interface Iterable<Object>
Specified by:
iterator in interface org.springframework.data.repository.query.ParameterAccessor

getPageable

public org.springframework.data.domain.Pageable getPageable()
Specified by:
getPageable in interface org.springframework.data.repository.query.ParameterAccessor

getSort

public org.springframework.data.domain.Sort getSort()
Specified by:
getSort in interface org.springframework.data.repository.query.ParameterAccessor

getBindableValue

public Object getBindableValue(int index)
Specified by:
getBindableValue in interface org.springframework.data.repository.query.ParameterAccessor

getMaxDistance

public Distance getMaxDistance()
Description copied from interface: MongoParameterAccessor
Returns a Distance to be applied to Mongo geo queries.

Specified by:
getMaxDistance in interface MongoParameterAccessor
Returns:
the maximum distance to apply to the geo query or null if there's no Distance parameter at all or the given value for it was null.

getGeoNearLocation

public Point getGeoNearLocation()
Description copied from interface: MongoParameterAccessor
Returns the Point to use for a geo-near query.

Specified by:
getGeoNearLocation in interface MongoParameterAccessor
Returns:


Copyright © 2011. All Rights Reserved.