Interface MongoPersistentProperty
- All Superinterfaces:
PersistentProperty<MongoPersistentProperty>
- All Known Implementing Classes:
BasicMongoPersistentProperty,CachingMongoPersistentProperty
MongoDB specific
PersistentProperty extension.- Author:
- Oliver Gierke, Patryk Wasik, Thomas Darimont, Christoph Strobl, Divya Srivastava
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumSimpleConverterimplementation to transform aMongoPersistentPropertyinto its field name. -
Method Summary
Modifier and TypeMethodDescriptiongetDBRef()Returns theDBRefif the property is a reference.Returns theDocumentReferenceif the property is a reference.Returns the name of the field a property is persisted to.intReturns the order of the field if defined.Class<?>Returns theJava FieldTypeof the field a property is persisted to.booleanReturns whether the property uses an annotated field name throughField.default booleanbooleanReturns whether the property is aDBRef.booleanReturns whether the property is aDocumentReference.booleanReturns whether the property is explicitly marked as an identifier property of the owningPersistentEntity.booleanReturns true when property being annotated withLanguage.booleanReturns true whether the property indicates the documents language either by having agetFieldName()equal to language or being annotated withLanguage.booleanReturns whether the property holds the documents score calculated by text search.default booleanbooleanReturns whether property access shall be used for reading the property value.booleanReturns whether the property should be written to the database if its value is null.Methods inherited from interface org.springframework.data.mapping.PersistentProperty
findAnnotation, findPropertyOrOwnerAnnotation, getAccessorForOwner, getActualType, getAssociation, getAssociationTargetType, getAssociationTargetTypeInformation, getComponentType, getField, getGetter, getMapValueType, getName, getOwner, getPersistentEntityTypeInformation, getRawType, getRequiredAnnotation, getRequiredAssociation, getRequiredField, getRequiredGetter, getRequiredSetter, getRequiredWither, getSetter, getSpelExpression, getType, getTypeInformation, getWither, hasActualTypeAnnotation, isAnnotationPresent, isArray, isAssociation, isCollectionLike, isEntity, isIdProperty, isImmutable, isMap, isTransient, isVersionProperty, isWritable
-
Method Details
-
getFieldName
String getFieldName()Returns the name of the field a property is persisted to.- Returns:
-
hasExplicitFieldName
boolean hasExplicitFieldName()Returns whether the property uses an annotated field name throughField.- Returns:
-
getFieldType
Class<?> getFieldType()Returns theJava FieldTypeof the field a property is persisted to.- Returns:
- Since:
- 2.2
- See Also:
-
getFieldOrder
int getFieldOrder()Returns the order of the field if defined. Will return -1 if undefined.- Returns:
-
writeNullValues
boolean writeNullValues()Returns whether the property should be written to the database if its value is null.- Returns:
- Since:
- 3.3
- See Also:
-
isDbReference
boolean isDbReference()Returns whether the property is aDBRef. If this returns true you can expectgetDBRef()to return an non-null value.- Returns:
-
isDocumentReference
boolean isDocumentReference()Returns whether the property is aDocumentReference. If this returns true you can expectgetDocumentReference()to return an non-null value.- Returns:
- Since:
- 3.3
-
isExplicitIdProperty
boolean isExplicitIdProperty()Returns whether the property is explicitly marked as an identifier property of the owningPersistentEntity. A property is an explicit id property if it is annotated with @seeId.- Returns:
-
isLanguageProperty
boolean isLanguageProperty()Returns true whether the property indicates the documents language either by having agetFieldName()equal to language or being annotated withLanguage.- Returns:
- Since:
- 1.6
-
isExplicitLanguageProperty
boolean isExplicitLanguageProperty()Returns true when property being annotated withLanguage.- Returns:
- Since:
- 1.6.1
-
isTextScoreProperty
boolean isTextScoreProperty()Returns whether the property holds the documents score calculated by text search.
It's marked withTextScore.- Returns:
- Since:
- 1.6
-
getDBRef
Returns theDBRefif the property is a reference.- Returns:
- See Also:
-
getDocumentReference
Returns theDocumentReferenceif the property is a reference.- Returns:
- null if not present.
- Since:
- 3.3
- See Also:
-
usePropertyAccess
boolean usePropertyAccess()Returns whether property access shall be used for reading the property value. This means it will use the getter instead of field access.- Specified by:
usePropertyAccessin interfacePersistentProperty<MongoPersistentProperty>- Returns:
-
hasExplicitWriteTarget
default boolean hasExplicitWriteTarget()- Returns:
- true if the property defines an explicit
target type. - Since:
- 2.2
-
isUnwrapped
default boolean isUnwrapped()- Returns:
- true if the property should be unwrapped.
- Since:
- 3.2
-
getEncryptionKeyIds
Collection<Object> getEncryptionKeyIds()- Returns:
- the resolved encryption keyIds if applicable. An empty
Collectionif no keyIds specified. null noEncryptedannotation found. - Since:
- 3.3
-