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, usePropertyAccess
equals, getActualType, getActualTypeInformation, getAssociation, getAssociationTargetType, getComponentType, getField, getGetter, getMapValueType, getName, getOwner, getPersistentEntityTypeInformation, getPersistentEntityTypes, getProperty, getRawType, getSetter, getType, getTypeInformation, getWither, hashCode, isArray, isCollectionLike, isEntity, isImmutable, isMap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasExplicitWriteTarget, isUnwrapped, usePropertyAccess
findAnnotation, 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, isWritable
public 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_TYPES
public boolean isExplicitIdProperty()
MongoPersistentProperty
PersistentEntity
.
A property is an explicit id property if it is annotated with @see Id
.isExplicitIdProperty
in interface MongoPersistentProperty
public String getFieldName()
Document
.getFieldName
in interface MongoPersistentProperty
public Class<?> getFieldType()
MongoPersistentProperty
Java FieldType
of the field a property is persisted to.getFieldType
in interface MongoPersistentProperty
FieldType
protected boolean hasExplicitFieldName()
Field
having non blank
Field.value()
present.public int getFieldOrder()
MongoPersistentProperty
getFieldOrder
in interface MongoPersistentProperty
public boolean writeNullValues()
MongoPersistentProperty
writeNullValues
in interface MongoPersistentProperty
Field.Write
protected Association<MongoPersistentProperty> createAssociation()
createAssociation
in class AbstractPersistentProperty<MongoPersistentProperty>
public boolean isDbReference()
MongoPersistentProperty
DBRef
. If this returns true you can expect
MongoPersistentProperty.getDBRef()
to return an non-null value.isDbReference
in interface MongoPersistentProperty
public boolean isDocumentReference()
MongoPersistentProperty
DocumentReference
. If this returns true you can expect
MongoPersistentProperty.getDocumentReference()
to return an non-null value.isDocumentReference
in interface MongoPersistentProperty
@Nullable public DBRef getDBRef()
MongoPersistentProperty
DBRef
if the property is a reference.getDBRef
in interface MongoPersistentProperty
MongoPersistentProperty.isDbReference()
@Nullable public DocumentReference getDocumentReference()
MongoPersistentProperty
DocumentReference
if the property is a reference.getDocumentReference
in interface MongoPersistentProperty
MongoPersistentProperty.isDocumentReference()
public boolean isLanguageProperty()
MongoPersistentProperty
MongoPersistentProperty.getFieldName()
equal
to language or being annotated with Language
.isLanguageProperty
in interface MongoPersistentProperty
public boolean isExplicitLanguageProperty()
MongoPersistentProperty
Language
.isExplicitLanguageProperty
in interface MongoPersistentProperty
public boolean isTextScoreProperty()
MongoPersistentProperty
TextScore
.isTextScoreProperty
in interface MongoPersistentProperty
public EvaluationContext getEvaluationContext(@Nullable Object rootObject)
EvaluationContext
for a specific root object.rootObject
- can be null.public Collection<Object> getEncryptionKeyIds()
getEncryptionKeyIds
in interface MongoPersistentProperty
Collection
if no keyIds specified.
null no Encrypted
annotation found.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.