Spring Data MongoDB - Core

org.springframework.data.mongodb.core.aggregation
Class TypeBasedAggregationOperationContext

java.lang.Object
  extended by org.springframework.data.mongodb.core.aggregation.TypeBasedAggregationOperationContext
All Implemented Interfaces:
AggregationOperationContext

public class TypeBasedAggregationOperationContext
extends Object
implements AggregationOperationContext

AggregationOperationContext aware of a particular type and a MappingContext to potentially translate property references into document field names.

Since:
1.3
Author:
Oliver Gierke

Constructor Summary
TypeBasedAggregationOperationContext(Class<?> type, MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext, QueryMapper mapper)
          Creates a new TypeBasedAggregationOperationContext for the given type, MappingContext and QueryMapper.
 
Method Summary
 com.mongodb.DBObject getMappedObject(com.mongodb.DBObject dbObject)
          Returns the mapped DBObject, potentially converting the source considering mapping metadata etc.
 org.springframework.data.mongodb.core.aggregation.ExposedFields.FieldReference getReference(Field field)
          Returns a ExposedFields.FieldReference for the given field or null if the context does not expose the given field.
 org.springframework.data.mongodb.core.aggregation.ExposedFields.FieldReference getReference(String name)
          Returns the ExposedFields.FieldReference for the field with the given name or null if the context does not expose a field with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeBasedAggregationOperationContext

public TypeBasedAggregationOperationContext(Class<?> type,
                                            MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext,
                                            QueryMapper mapper)
Creates a new TypeBasedAggregationOperationContext for the given type, MappingContext and QueryMapper.

Parameters:
type - must not be null.
mappingContext - must not be null.
mapper - must not be null.
Method Detail

getMappedObject

public com.mongodb.DBObject getMappedObject(com.mongodb.DBObject dbObject)
Description copied from interface: AggregationOperationContext
Returns the mapped DBObject, potentially converting the source considering mapping metadata etc.

Specified by:
getMappedObject in interface AggregationOperationContext
Parameters:
dbObject - will never be null.
Returns:
must not be null.

getReference

public org.springframework.data.mongodb.core.aggregation.ExposedFields.FieldReference getReference(Field field)
Description copied from interface: AggregationOperationContext
Returns a ExposedFields.FieldReference for the given field or null if the context does not expose the given field.

Specified by:
getReference in interface AggregationOperationContext
Parameters:
field - must not be null.
Returns:

getReference

public org.springframework.data.mongodb.core.aggregation.ExposedFields.FieldReference getReference(String name)
Description copied from interface: AggregationOperationContext
Returns the ExposedFields.FieldReference for the field with the given name or null if the context does not expose a field with the given name.

Specified by:
getReference in interface AggregationOperationContext
Parameters:
name - must not be null or empty.
Returns:

Spring Data MongoDB - Core

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