public class BasicMongoPersistentProperty extends AnnotationBasedPersistentProperty<MongoPersistentProperty> implements MongoPersistentProperty
PersistentProperty implementation.MongoPersistentProperty.PropertyToFieldNameConverter| Modifier and Type | Field and Description |
|---|---|
static String |
ID_FIELD_NAME |
| Constructor and Description |
|---|
BasicMongoPersistentProperty(Property property,
MongoPersistentEntity<?> owner,
SimpleTypeHolder simpleTypeHolder,
FieldNamingStrategy fieldNamingStrategy)
Creates a new
BasicMongoPersistentProperty. |
| Modifier and Type | Method and Description |
|---|---|
protected Association<MongoPersistentProperty> |
createAssociation() |
DBRef |
getDBRef()
Returns the
DBRef if the property is a reference. |
DocumentReference |
getDocumentReference()
Returns the
DocumentReference if the property is a reference. |
Collection<Object> |
getEncryptionKeyIds() |
EvaluationContext |
getEvaluationContext(Object rootObject)
Obtain the
EvaluationContext for a specific root object. |
String |
getFieldName()
Returns the key to be used to store the value of the property inside a Mongo
Document. |
int |
getFieldOrder()
Returns the order of the field if defined.
|
Class<?> |
getFieldType()
Returns the
Java FieldType of the field a property is persisted to. |
protected boolean |
hasExplicitFieldName() |
boolean |
isDbReference()
Returns whether the property is a
DBRef. |
boolean |
isDocumentReference()
Returns whether the property is a
DocumentReference. |
boolean |
isExplicitIdProperty()
Returns whether the property is explicitly marked as an identifier property of the owning
PersistentEntity. |
boolean |
isExplicitLanguageProperty()
Returns true when property being annotated with
Language. |
boolean |
isIdProperty()
Also considers fields as id that are of supported id type and name.
|
boolean |
isLanguageProperty()
Returns true whether the property indicates the documents language either by having a
MongoPersistentProperty.getFieldName() equal
to language or being annotated with Language. |
boolean |
isTextScoreProperty()
Returns whether the property holds the documents score calculated by text search.
|
boolean |
writeNullValues()
Returns whether the property should be written to the database if its value is null.
|
findAnnotation, findPropertyOrOwnerAnnotation, getAssociationTargetTypeInformation, getSpelExpression, isAnnotationPresent, isAssociation, isTransient, isVersionProperty, isWritable, toString, usePropertyAccessequals, getActualType, getActualTypeInformation, getAssociation, getAssociationTargetType, getComponentType, getField, getGetter, getMapValueType, getName, getOwner, getPersistentEntityTypeInformation, getPersistentEntityTypes, getProperty, getRawType, getSetter, getType, getTypeInformation, getWither, hashCode, isArray, isCollectionLike, isEntity, isImmutable, isMapclone, finalize, getClass, notify, notifyAll, wait, wait, waithasExplicitWriteTarget, isUnwrapped, usePropertyAccessfindAnnotation, findPropertyOrOwnerAnnotation, getAccessorForOwner, getActualType, getAssociation, getAssociationTargetType, getAssociationTargetTypeInformation, getComponentType, getField, getGetter, getMapValueType, getName, getOwner, getPersistentEntityTypeInformation, getPersistentEntityTypes, getRawType, getRequiredAnnotation, getRequiredAssociation, getRequiredField, getRequiredGetter, getRequiredSetter, getRequiredWither, getSetter, getSpelExpression, getType, getTypeInformation, getWither, hasActualTypeAnnotation, isAnnotationPresent, isArray, isAssociation, isCollectionLike, isEntity, isImmutable, isMap, isTransient, isVersionProperty, isWritablepublic static final String ID_FIELD_NAME
public BasicMongoPersistentProperty(Property property, MongoPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder, @Nullable FieldNamingStrategy fieldNamingStrategy)
BasicMongoPersistentProperty.property - the source property.owner - the owing entity.simpleTypeHolder - must not be null.fieldNamingStrategy - can be null.public boolean isIdProperty()
isIdProperty in interface PersistentProperty<MongoPersistentProperty>isIdProperty in class AnnotationBasedPersistentProperty<MongoPersistentProperty>SUPPORTED_ID_PROPERTY_NAMES,
SUPPORTED_ID_TYPESpublic boolean isExplicitIdProperty()
MongoPersistentPropertyPersistentEntity.
A property is an explicit id property if it is annotated with @see Id.isExplicitIdProperty in interface MongoPersistentPropertypublic String getFieldName()
Document.getFieldName in interface MongoPersistentPropertypublic Class<?> getFieldType()
MongoPersistentPropertyJava FieldType of the field a property is persisted to.getFieldType in interface MongoPersistentPropertyFieldTypeprotected boolean hasExplicitFieldName()
Field having non blank
Field.value() present.public int getFieldOrder()
MongoPersistentPropertygetFieldOrder in interface MongoPersistentPropertypublic boolean writeNullValues()
MongoPersistentPropertywriteNullValues in interface MongoPersistentPropertyField.Writeprotected Association<MongoPersistentProperty> createAssociation()
createAssociation in class AbstractPersistentProperty<MongoPersistentProperty>public boolean isDbReference()
MongoPersistentPropertyDBRef. If this returns true you can expect
MongoPersistentProperty.getDBRef() to return an non-null value.isDbReference in interface MongoPersistentPropertypublic boolean isDocumentReference()
MongoPersistentPropertyDocumentReference. If this returns true you can expect
MongoPersistentProperty.getDocumentReference() to return an non-null value.isDocumentReference in interface MongoPersistentProperty@Nullable public DBRef getDBRef()
MongoPersistentPropertyDBRef if the property is a reference.getDBRef in interface MongoPersistentPropertyMongoPersistentProperty.isDbReference()@Nullable public DocumentReference getDocumentReference()
MongoPersistentPropertyDocumentReference if the property is a reference.getDocumentReference in interface MongoPersistentPropertyMongoPersistentProperty.isDocumentReference()public boolean isLanguageProperty()
MongoPersistentPropertyMongoPersistentProperty.getFieldName() equal
to language or being annotated with Language.isLanguageProperty in interface MongoPersistentPropertypublic boolean isExplicitLanguageProperty()
MongoPersistentPropertyLanguage.isExplicitLanguageProperty in interface MongoPersistentPropertypublic boolean isTextScoreProperty()
MongoPersistentPropertyTextScore.isTextScoreProperty in interface MongoPersistentPropertypublic EvaluationContext getEvaluationContext(@Nullable Object rootObject)
EvaluationContext for a specific root object.rootObject - can be null.public Collection<Object> getEncryptionKeyIds()
getEncryptionKeyIds in interface MongoPersistentPropertyCollection if no keyIds specified.
null no Encrypted annotation found.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.