protected static class QueryMapper.MetadataBackedField extends QueryMapper.Field
DocumentField to be backed with mapping metadata.name| Constructor and Description |
|---|
MetadataBackedField(String name,
MongoPersistentEntity<?> entity,
MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> context)
Creates a new
QueryMapper.MetadataBackedField with the given name, MongoPersistentEntity and
MappingContext. |
MetadataBackedField(String name,
MongoPersistentEntity<?> entity,
MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> context,
MongoPersistentProperty property)
Creates a new
QueryMapper.MetadataBackedField with the given name, MongoPersistentEntity and
MappingContext with the given MongoPersistentProperty. |
| Modifier and Type | Method and Description |
|---|---|
Association<MongoPersistentProperty> |
getAssociation() |
protected Converter<MongoPersistentProperty,String> |
getAssociationConverter()
Return the
Converter to use for creating the mapped key of an association. |
String |
getMappedKey()
Returns the key to be used in the mapped document eventually.
|
protected PersistentPropertyPath<MongoPersistentProperty> |
getPath() |
MongoPersistentProperty |
getProperty()
Returns the underlying
MongoPersistentProperty backing the field. |
protected Converter<MongoPersistentProperty,String> |
getPropertyConverter()
Return the
Converter to be used to created the mapped key. |
MongoPersistentEntity<?> |
getPropertyEntity()
Returns the
MongoPersistentEntity that field is conatined in. |
TypeInformation<?> |
getTypeHint() |
boolean |
isAssociation()
Returns whether the field represents an association.
|
boolean |
isIdField()
Returns whether the current field is the id field.
|
QueryMapper.MetadataBackedField |
with(String name)
Returns a new
DocumentField with the given name. |
containsAssociationpublic MetadataBackedField(String name, MongoPersistentEntity<?> entity, MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> context)
QueryMapper.MetadataBackedField with the given name, MongoPersistentEntity and
MappingContext.name - must not be null or empty.entity - must not be null.context - must not be null.public MetadataBackedField(String name, MongoPersistentEntity<?> entity, MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> context, @Nullable MongoPersistentProperty property)
QueryMapper.MetadataBackedField with the given name, MongoPersistentEntity and
MappingContext with the given MongoPersistentProperty.name - must not be null or empty.entity - must not be null.context - must not be null.property - may be null.public QueryMapper.MetadataBackedField with(String name)
QueryMapper.FieldDocumentField with the given name.with in class QueryMapper.Fieldname - must not be null or empty.public boolean isIdField()
QueryMapper.FieldisIdField in class QueryMapper.Fieldpublic MongoPersistentProperty getProperty()
QueryMapper.FieldMongoPersistentProperty backing the field. For path traversals this will be the
property that represents the value to handle. This means it'll be the leaf property for plain paths or the
association property in case we refer to an association somewhere in the path.getProperty in class QueryMapper.Fieldpublic MongoPersistentEntity<?> getPropertyEntity()
QueryMapper.FieldMongoPersistentEntity that field is conatined in.getPropertyEntity in class QueryMapper.Fieldpublic boolean isAssociation()
QueryMapper.FieldisAssociation in class QueryMapper.Fieldpublic Association<MongoPersistentProperty> getAssociation()
getAssociation in class QueryMapper.Fieldpublic String getMappedKey()
QueryMapper.FieldgetMappedKey in class QueryMapper.Field@Nullable protected PersistentPropertyPath<MongoPersistentProperty> getPath()
protected Converter<MongoPersistentProperty,String> getPropertyConverter()
Converter to be used to created the mapped key. Default implementation will use
MongoPersistentProperty.PropertyToFieldNameConverter.protected Converter<MongoPersistentProperty,String> getAssociationConverter()
Converter to use for creating the mapped key of an association. Default implementation is
QueryMapper.AssociationConverter.public TypeInformation<?> getTypeHint()
getTypeHint in class QueryMapper.FieldCopyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.