Class CachingMongoPersistentProperty
java.lang.Object
org.springframework.data.mapping.model.AbstractPersistentProperty<P>
org.springframework.data.mapping.model.AnnotationBasedPersistentProperty<MongoPersistentProperty>
org.springframework.data.mongodb.core.mapping.BasicMongoPersistentProperty
org.springframework.data.mongodb.core.mapping.CachingMongoPersistentProperty
- All Implemented Interfaces:
PersistentProperty<MongoPersistentProperty>,MongoPersistentProperty
- Author:
- Oliver Gierke, Mark Paluch
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.mapping.MongoPersistentProperty
MongoPersistentProperty.PropertyToFieldNameConverter -
Field Summary
Fields inherited from class org.springframework.data.mongodb.core.mapping.BasicMongoPersistentProperty
ID_FIELD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionCachingMongoPersistentProperty(Property property, MongoPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder, FieldNamingStrategy fieldNamingStrategy) Creates a newCachingMongoPersistentProperty. -
Method Summary
Modifier and TypeMethodDescriptiongetDBRef()Returns theDBRefif the property is a reference.Returns the key to be used to store the value of the property inside a MongoDocument.Class<?>Returns theJava FieldTypeof the field a property is persisted to.booleanbooleanReturns whether the property is aDBRef.booleanAlso considers fields as id that are of supported id type and name.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 class org.springframework.data.mongodb.core.mapping.BasicMongoPersistentProperty
createAssociation, getDocumentReference, getEncryptionKeyIds, getEvaluationContext, getFieldOrder, hasExplicitFieldName, isDocumentReference, isExplicitIdProperty, isExplicitLanguageProperty, isLanguageProperty, isTextScorePropertyMethods inherited from class org.springframework.data.mapping.model.AnnotationBasedPersistentProperty
findAnnotation, findPropertyOrOwnerAnnotation, getAssociationTargetTypeInformation, getSpelExpression, isAnnotationPresent, isVersionProperty, isWritable, toStringMethods inherited from class org.springframework.data.mapping.model.AbstractPersistentProperty
equals, getActualType, getActualTypeInformation, getAssociation, getAssociationTargetType, getComponentType, getField, getGetter, getMapValueType, getName, getOwner, getPersistentEntityTypeInformation, getProperty, getRawType, getSetter, getType, getTypeInformation, getWither, hashCode, isArray, isCollectionLike, isEntity, isImmutable, isMapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.data.mongodb.core.mapping.MongoPersistentProperty
hasExplicitWriteTarget, isUnwrappedMethods 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, isCollectionLike, isEntity, isImmutable, isMap, isVersionProperty, isWritable
-
Constructor Details
-
CachingMongoPersistentProperty
public CachingMongoPersistentProperty(Property property, MongoPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder, @Nullable FieldNamingStrategy fieldNamingStrategy) Creates a newCachingMongoPersistentProperty.- Parameters:
property- must not be null.owner- must not be null.simpleTypeHolder- must not be null.fieldNamingStrategy- can be null.
-
-
Method Details
-
isIdProperty
public boolean isIdProperty()Description copied from class:BasicMongoPersistentPropertyAlso considers fields as id that are of supported id type and name.- Specified by:
isIdPropertyin interfacePersistentProperty<MongoPersistentProperty>- Overrides:
isIdPropertyin classBasicMongoPersistentProperty- See Also:
-
BasicMongoPersistentProperty.SUPPORTED_ID_PROPERTY_NAMESBasicMongoPersistentProperty.SUPPORTED_ID_TYPES
-
isAssociation
public boolean isAssociation()- Specified by:
isAssociationin interfacePersistentProperty<MongoPersistentProperty>- Overrides:
isAssociationin classAnnotationBasedPersistentProperty<MongoPersistentProperty>
-
getFieldName
Description copied from class:BasicMongoPersistentPropertyReturns the key to be used to store the value of the property inside a MongoDocument.- Specified by:
getFieldNamein interfaceMongoPersistentProperty- Overrides:
getFieldNamein classBasicMongoPersistentProperty- Returns:
-
writeNullValues
public boolean writeNullValues()Description copied from interface:MongoPersistentPropertyReturns whether the property should be written to the database if its value is null.- Specified by:
writeNullValuesin interfaceMongoPersistentProperty- Overrides:
writeNullValuesin classBasicMongoPersistentProperty- Returns:
- See Also:
-
getFieldType
Description copied from interface:MongoPersistentPropertyReturns theJava FieldTypeof the field a property is persisted to.- Specified by:
getFieldTypein interfaceMongoPersistentProperty- Overrides:
getFieldTypein classBasicMongoPersistentProperty- Returns:
- See Also:
-
usePropertyAccess
public boolean usePropertyAccess()Description copied from interface:MongoPersistentPropertyReturns 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 interfaceMongoPersistentProperty- Specified by:
usePropertyAccessin interfacePersistentProperty<MongoPersistentProperty>- Overrides:
usePropertyAccessin classAnnotationBasedPersistentProperty<MongoPersistentProperty>
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfacePersistentProperty<MongoPersistentProperty>- Overrides:
isTransientin classAnnotationBasedPersistentProperty<MongoPersistentProperty>
-
isDbReference
public boolean isDbReference()Description copied from interface:MongoPersistentPropertyReturns whether the property is aDBRef. If this returns true you can expectMongoPersistentProperty.getDBRef()to return an non-null value.- Specified by:
isDbReferencein interfaceMongoPersistentProperty- Overrides:
isDbReferencein classBasicMongoPersistentProperty- Returns:
-
getDBRef
Description copied from interface:MongoPersistentPropertyReturns theDBRefif the property is a reference.- Specified by:
getDBRefin interfaceMongoPersistentProperty- Overrides:
getDBRefin classBasicMongoPersistentProperty- Returns:
- See Also:
-