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.| Constructor and Description |
|---|
TypeBasedAggregationOperationContext(Class<?> type,
MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext,
QueryMapper mapper)
Creates a new
TypeBasedAggregationOperationContext for the given type, MappingContext and
QueryMapper. |
| Modifier and Type | Method and Description |
|---|---|
AggregationOperationContext |
continueOnMissingFieldReference()
This toggle allows the
context to use any given field name without checking for
its existence. |
AggregationOperationContext |
continueOnMissingFieldReference(Class<?> type)
This toggle allows the
context to use any given field name without checking for
its existence. |
Fields |
getFields(Class<?> type)
Returns the
Fields exposed by the type. |
org.bson.Document |
getMappedObject(org.bson.Document document)
Returns the mapped
Document, potentially converting the source considering mapping metadata etc. |
org.bson.Document |
getMappedObject(org.bson.Document document,
Class<?> type)
Returns the mapped
Document, potentially converting the source considering mapping metadata for the given
type. |
ExposedFields.FieldReference |
getReference(Field field)
Returns a
ExposedFields.FieldReference for the given field. |
ExposedFields.FieldReference |
getReference(String name)
Returns the
ExposedFields.FieldReference for the field with the given name. |
protected ExposedFields.FieldReference |
getReferenceFor(Field field) |
Class<?> |
getType() |
public TypeBasedAggregationOperationContext(Class<?> type, MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> mappingContext, QueryMapper mapper)
TypeBasedAggregationOperationContext for the given type, MappingContext and
QueryMapper.type - must not be null.mappingContext - must not be null.mapper - must not be null.public org.bson.Document getMappedObject(org.bson.Document document)
AggregationOperationContextDocument, potentially converting the source considering mapping metadata etc.getMappedObject in interface AggregationOperationContextdocument - will never be null.public org.bson.Document getMappedObject(org.bson.Document document,
@Nullable
Class<?> type)
AggregationOperationContextDocument, potentially converting the source considering mapping metadata for the given
type.getMappedObject in interface AggregationOperationContextdocument - will never be null.type - can be null.public ExposedFields.FieldReference getReference(Field field)
AggregationOperationContextExposedFields.FieldReference for the given field.getReference in interface AggregationOperationContextfield - must not be null.ExposedFields.FieldReference for the given Field.public ExposedFields.FieldReference getReference(String name)
AggregationOperationContextExposedFields.FieldReference for the field with the given name.getReference in interface AggregationOperationContextname - must not be null or empty.ExposedFields.FieldReference for the field with given name.public Fields getFields(Class<?> type)
AggregationOperationContextFields exposed by the type. May be a class or an interface. The default
implementation uses property descriptors discover fields from a
Class.getFields in interface AggregationOperationContexttype - must not be null.BeanUtils.getPropertyDescriptor(Class, String)public AggregationOperationContext continueOnMissingFieldReference()
AggregationOperationContextcontext to use any given field name without checking for
its existence. Typically the AggregationOperationContext fails when referencing unknown fields, those that
are not present in one of the previous stages or the input source, throughout the pipeline.continueOnMissingFieldReference in interface AggregationOperationContextAggregationOperationContext.public AggregationOperationContext continueOnMissingFieldReference(Class<?> type)
context to use any given field name without checking for
its existence. Typically, the AggregationOperationContext fails when referencing unknown fields, those that
are not present in one of the previous stages or the input source, throughout the pipeline.type - The domain type to map fields to.AggregationOperationContext.RelaxedTypeBasedAggregationOperationContextprotected ExposedFields.FieldReference getReferenceFor(Field field)
public Class<?> getType()
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.